#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 */
typedef int /*<<< orphan*/ FIZZ_BUZZ;
typedef int /*<<< orphan*/ FIZZ;
typedef int /*<<< orphan*/ BUZZ;

/* Variables and functions */
int /*<<< orphan*/ INT_MAX;
int /*<<< orphan*/ free(char *);
char const *intToString(int, char *);
int log10(int /*<<< orphan*/);
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
char **fizzBuzz(int n, int *returnSize) {
  static const char FIZZ_BUZZ[] = "FizzBuzz";
  static const char FIZZ[] = "Fizz";
  static const char BUZZ[] = "Buzz";
  *returnSize = 0;
  char **result = (char **)malloc(sizeof(*result) * n);
  if (result) {
    *returnSize = n;
    for (int index = 0, value = 1; index < n; ++index, ++value) {
      char *entry = NULL;
      if (value % 15 == 0) {
        entry = (char *)malloc(1 + sizeof(*entry) * sizeof(FIZZ_BUZZ) /
                                       sizeof(FIZZ_BUZZ[0]));
        if (entry) {
          (void)strcpy(entry, FIZZ_BUZZ);
        }
      } else if (value % 5 == 0) {
        entry =
            (char *)malloc(1 + sizeof(*entry) * sizeof(BUZZ) / sizeof(BUZZ[0]));
        if (entry) {
          (void)strcpy(entry, BUZZ);
        }
      } else if (value % 3 == 0) {
        entry =
            (char *)malloc(1 + sizeof(*entry) * sizeof(FIZZ) / sizeof(FIZZ[0]));
        if (entry) {
          (void)strcpy(entry, FIZZ);
        }
      } else {
        entry = (char *)malloc(1 + sizeof(*entry) * (1 + log10(INT_MAX)));
        if (entry) {
          (void)strcpy(entry, intToString(value, entry));
        }
      }
      if (!entry) {
        for (int j = 0; j < index; ++j) {
          free(result[j]);
          result[j] = NULL;
        }
        return NULL;
      } else {
        result[index] = entry;
      }
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<fizzBuzz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1363 <fizzBuzz+0x213>
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x24(%rbp)
movl   $0x1,-0x28(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    135e <fizzBuzz+0x20e>
movq   $0x0,-0x30(%rbp)
mov    -0x28(%rbp),%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11f4 <fizzBuzz+0xa4>
mov    $0xa,%edi
call   1060 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     11ef <fizzBuzz+0x9f>
mov    -0x30(%rbp),%rdi
lea    0xe16(%rip),%rsi
call   1040 <strcpy@plt>
jmp    12d8 <fizzBuzz+0x188>
mov    -0x28(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1236 <fizzBuzz+0xe6>
mov    $0x6,%edi
call   1060 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1231 <fizzBuzz+0xe1>
mov    -0x30(%rbp),%rdi
lea    0xde2(%rip),%rsi
call   1040 <strcpy@plt>
jmp    12d3 <fizzBuzz+0x183>
mov    -0x28(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1278 <fizzBuzz+0x128>
mov    $0x6,%edi
call   1060 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1273 <fizzBuzz+0x123>
mov    -0x30(%rbp),%rdi
lea    0xd9b(%rip),%rsi
call   1040 <strcpy@plt>
jmp    12ce <fizzBuzz+0x17e>
mov    0x2d69(%rip),%rax
mov    (%rax),%edi
call   1070 <log10@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     12c9 <fizzBuzz+0x179>
mov    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%edi
mov    -0x30(%rbp),%rsi
call   1050 <intToString@plt>
mov    -0x40(%rbp),%rdi
mov    %rax,%rsi
call   1040 <strcpy@plt>
jmp    12ce <fizzBuzz+0x17e>
jmp    12d3 <fizzBuzz+0x183>
jmp    12d8 <fizzBuzz+0x188>
cmpq   $0x0,-0x30(%rbp)
jne    1332 <fizzBuzz+0x1e2>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1325 <fizzBuzz+0x1d5>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12ea <fizzBuzz+0x19a>
movq   $0x0,-0x8(%rbp)
jmp    136b <fizzBuzz+0x21b>
mov    -0x30(%rbp),%rdx
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
jmp    1347 <fizzBuzz+0x1f7>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    119e <fizzBuzz+0x4e>
jmp    1363 <fizzBuzz+0x213>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fizzBuzz>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbp
mov    %edi,%ebx
movl   $0x0,(%rsi)
lea    0x0(,%rbx,8),%edi
call   1060 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     12fd <fizzBuzz+0x1ad>
mov    %ebx,0x0(%rbp)
test   %ebx,%ebx
jle    12fd <fizzBuzz+0x1ad>
mov    %ebx,%r13d
mov    $0x1,%ebx
xor    %r12d,%r12d
jmp    11d6 <fizzBuzz+0x86>
cs nopw 0x0(%rax,%rax,1)
mov    $0x6,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     12ca <fizzBuzz+0x17a>
mov    %rax,%rbp
mov    %rax,%rdi
lea    0xe4e(%rip),%rsi
call   1040 <strcpy@plt>
mov    %rbp,(%r14,%r15,8)
add    $0x1,%rbx
cmp    %r12,%r13
je     12fd <fizzBuzz+0x1ad>
mov    %r12,%r15
add    $0x1,%r12
mov    %rbx,%rax
movabs $0x8888888888888889,%rcx
88 88 88
mul    %rcx
shr    $0x3,%rdx
lea    (%rdx,%rdx,4),%esi
mov    %rbx,%rax
movabs $0xcccccccccccccccd,%rcx
cc cc cc
mul    %rcx
mov    %rdx,%rcx
lea    (%rsi,%rsi,2),%esi
add    $0xffffffff,%esi
mov    %rbx,%rax
movabs $0xaaaaaaaaaaaaaaab,%rdx
aa aa aa
mul    %rdx
cmp    %r15d,%esi
jne    1250 <fizzBuzz+0x100>
mov    $0xa,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     12ca <fizzBuzz+0x17a>
mov    %rax,%rbp
mov    %rax,%rdi
lea    0xdbe(%rip),%rsi
jmp    11c0 <fizzBuzz+0x70>
nopw   0x0(%rax,%rax,1)
shr    $0x2,%rcx
lea    (%rcx,%rcx,4),%rax
add    $0xffffffffffffffff,%rax
cmp    %r15d,%eax
je     11a0 <fizzBuzz+0x50>
shr    %rdx
lea    (%rdx,%rdx,2),%rax
add    $0xffffffffffffffff,%rax
cmp    %r15d,%eax
jne    1296 <fizzBuzz+0x146>
mov    $0x6,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     12ca <fizzBuzz+0x17a>
mov    %rax,%rbp
mov    %rax,%rdi
lea    0xd78(%rip),%rsi
jmp    11c0 <fizzBuzz+0x70>
mov    0x2d4b(%rip),%rax
mov    (%rax),%edi
call   1070 <log10@plt>
lea    0x2(%rax),%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     12ca <fizzBuzz+0x17a>
mov    %rax,%rbp
mov    %r12d,%edi
mov    %rax,%rsi
call   1050 <intToString@plt>
mov    %rbp,%rdi
mov    %rax,%rsi
jmp    11c0 <fizzBuzz+0x70>
test   %r15,%r15
je     12fa <fizzBuzz+0x1aa>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
movq   $0x0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    12e0 <fizzBuzz+0x190>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@fizzBuzz.FIZZ_BUZZ = internal constant [9 x i8] c"FizzBuzz\00"
@fizzBuzz.FIZZ = internal constant [5 x i8] c"Fizz\00"
@fizzBuzz.BUZZ = internal constant [5 x i8] c"Buzz\00"
@INT_MAX = global i32 0
define i8** @fizzBuzz(i32 %0, i32* %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
%11 = load i32*, i32** %5
store i32 0, i32* %11
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = mul i64 8, %13
%15 = trunc i64 %14 to i32
%16 = call i64 @malloc(i32 %15)
%17 = inttoptr i64 %16 to i8**
store i8** %17, i8*** %6
%18 = load i8**, i8*** %6
%19 = icmp ne i8** %18, null
br i1 %19, label %20, label %123
20: ; preds = %2
%21 = load i32, i32* %4
%22 = load i32*, i32** %5
store i32 %21, i32* %22
store i32 0, i32* %7
store i32 1, i32* %8
br label %23
23: ; preds = %117, %20
%24 = load i32, i32* %7
%25 = load i32, i32* %4
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %122
27: ; preds = %23
store i8* null, i8** %9
%28 = load i32, i32* %8
%29 = srem i32 %28, 15
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %40
31: ; preds = %27
%32 = call i64 @malloc(i32 10)
%33 = inttoptr i64 %32 to i8*
store i8* %33, i8** %9
%34 = load i8*, i8** %9
%35 = icmp ne i8* %34, null
br i1 %35, label %36, label %39
36: ; preds = %31
%37 = load i8*, i8** %9
%38 = call i32 @strcpy(i8* %37, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @fizzBuzz.FIZZ_BUZZ, i64 0, i64 0))
br label %39
39: ; preds = %36, %31
br label %87
40: ; preds = %27
%41 = load i32, i32* %8
%42 = srem i32 %41, 5
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %53
44: ; preds = %40
%45 = call i64 @malloc(i32 6)
%46 = inttoptr i64 %45 to i8*
store i8* %46, i8** %9
%47 = load i8*, i8** %9
%48 = icmp ne i8* %47, null
br i1 %48, label %49, label %52
49: ; preds = %44
%50 = load i8*, i8** %9
%51 = call i32 @strcpy(i8* %50, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fizzBuzz.BUZZ, i64 0, i64 0))
br label %52
52: ; preds = %49, %44
br label %86
53: ; preds = %40
%54 = load i32, i32* %8
%55 = srem i32 %54, 3
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %66
57: ; preds = %53
%58 = call i64 @malloc(i32 6)
%59 = inttoptr i64 %58 to i8*
store i8* %59, i8** %9
%60 = load i8*, i8** %9
%61 = icmp ne i8* %60, null
br i1 %61, label %62, label %65
62: ; preds = %57
%63 = load i8*, i8** %9
%64 = call i32 @strcpy(i8* %63, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fizzBuzz.FIZZ, i64 0, i64 0))
br label %65
65: ; preds = %62, %57
br label %85
66: ; preds = %53
%67 = load i32, i32* @INT_MAX
%68 = call i32 @log10(i32 %67)
%69 = add nsw i32 1, %68
%70 = sext i32 %69 to i64
%71 = mul i64 1, %70
%72 = add i64 1, %71
%73 = trunc i64 %72 to i32
%74 = call i64 @malloc(i32 %73)
%75 = inttoptr i64 %74 to i8*
store i8* %75, i8** %9
%76 = load i8*, i8** %9
%77 = icmp ne i8* %76, null
br i1 %77, label %78, label %84
78: ; preds = %66
%79 = load i8*, i8** %9
%80 = load i32, i32* %8
%81 = load i8*, i8** %9
%82 = call i8* @intToString(i32 %80, i8* %81)
%83 = call i32 @strcpy(i8* %79, i8* %82)
br label %84
84: ; preds = %78, %66
br label %85
85: ; preds = %84, %65
br label %86
86: ; preds = %85, %52
br label %87
87: ; preds = %86, %39
%88 = load i8*, i8** %9
%89 = icmp ne i8* %88, null
br i1 %89, label %110, label %90
90: ; preds = %87
store i32 0, i32* %10
br label %91
91: ; preds = %106, %90
%92 = load i32, i32* %10
%93 = load i32, i32* %7
%94 = icmp slt i32 %92, %93
br i1 %94, label %95, label %109
95: ; preds = %91
%96 = load i8**, i8*** %6
%97 = load i32, i32* %10
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds i8*, i8** %96, i64 %98
%100 = load i8*, i8** %99
%101 = call i32 @free(i8* %100)
%102 = load i8**, i8*** %6
%103 = load i32, i32* %10
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds i8*, i8** %102, i64 %104
store i8* null, i8** %105
br label %106
106: ; preds = %95
%107 = load i32, i32* %10
%108 = add nsw i32 %107, 1
store i32 %108, i32* %10
br label %91
109: ; preds = %91
store i8** null, i8*** %3
br label %125
110: ; preds = %87
%111 = load i8*, i8** %9
%112 = load i8**, i8*** %6
%113 = load i32, i32* %7
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds i8*, i8** %112, i64 %114
store i8* %111, i8** %115
br label %116
116: ; preds = %110
br label %117
117: ; preds = %116
%118 = load i32, i32* %7
%119 = add nsw i32 %118, 1
store i32 %119, i32* %7
%120 = load i32, i32* %8
%121 = add nsw i32 %120, 1
store i32 %121, i32* %8
br label %23
122: ; preds = %23
br label %123
123: ; preds = %122, %2
%124 = load i8**, i8*** %6
store i8** %124, i8*** %3
br label %125
125: ; preds = %123, %109
%126 = load i8**, i8*** %3
ret i8** %126
}

LLVM IR (-O2):
@fizzBuzz.FIZZ_BUZZ = internal constant [9 x i8] c"FizzBuzz\00"
@fizzBuzz.FIZZ = internal constant [5 x i8] c"Fizz\00"
@fizzBuzz.BUZZ = internal constant [5 x i8] c"Buzz\00"
@INT_MAX = global i32 0
define i8** @fizzBuzz(i32 %0, i32* nocapture writeonly %1) {
store i32 0, i32* %1
%3 = shl i32 %0, 3
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8**
%6 = icmp eq i64 %4, 0
br i1 %6, label %65, label %7
7: ; preds = %2
store i32 %0, i32* %1
%8 = icmp sgt i32 %0, 0
br i1 %8, label %9, label %65
9: ; preds = %7
%10 = zext i32 %0 to i64
br label %11
11: ; preds = %9, %59
%12 = phi i64 [ 0, %9 ], [ %62, %59 ]
%13 = phi i32 [ 1, %9 ], [ %63, %59 ]
%14 = urem i32 %13, 15
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %11
%17 = tail call i64 @malloc(i32 10)
%18 = inttoptr i64 %17 to i8*
%19 = icmp eq i64 %17, 0
br i1 %19, label %50, label %20
20: ; preds = %16
%21 = tail call i32 @strcpy(i8* %18, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @fizzBuzz.FIZZ_BUZZ, i64 0, i64 0))
br label %59
22: ; preds = %11
%23 = urem i32 %13, 5
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %31
25: ; preds = %22
%26 = tail call i64 @malloc(i32 6)
%27 = inttoptr i64 %26 to i8*
%28 = icmp eq i64 %26, 0
br i1 %28, label %50, label %29
29: ; preds = %25
%30 = tail call i32 @strcpy(i8* %27, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fizzBuzz.BUZZ, i64 0, i64 0))
br label %59
31: ; preds = %22
%32 = urem i32 %13, 3
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %40
34: ; preds = %31
%35 = tail call i64 @malloc(i32 6)
%36 = inttoptr i64 %35 to i8*
%37 = icmp eq i64 %35, 0
br i1 %37, label %50, label %38
38: ; preds = %34
%39 = tail call i32 @strcpy(i8* %36, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fizzBuzz.FIZZ, i64 0, i64 0))
br label %59
40: ; preds = %31
%41 = load i32, i32* @INT_MAX
%42 = tail call i32 @log10(i32 %41)
%43 = add i32 %42, 2
%44 = tail call i64 @malloc(i32 %43)
%45 = inttoptr i64 %44 to i8*
%46 = icmp eq i64 %44, 0
br i1 %46, label %50, label %47
47: ; preds = %40
%48 = tail call i8* @intToString(i32 %13, i8* %45)
%49 = tail call i32 @strcpy(i8* %45, i8* %48)
br label %59
50: ; preds = %40, %34, %25, %16
%51 = icmp eq i64 %12, 0
br i1 %51, label %65, label %52
52: ; preds = %50, %52
%53 = phi i64 [ %57, %52 ], [ 0, %50 ]
%54 = getelementptr inbounds i8*, i8** %5, i64 %53
%55 = load i8*, i8** %54
%56 = tail call i32 @free(i8* %55)
store i8* null, i8** %54
%57 = add nuw nsw i64 %53, 1
%58 = icmp eq i64 %57, %12
br i1 %58, label %65, label %52
59: ; preds = %20, %38, %47, %29
%60 = phi i8* [ %18, %20 ], [ %27, %29 ], [ %36, %38 ], [ %45, %47 ]
%61 = getelementptr inbounds i8*, i8** %5, i64 %12
store i8* %60, i8** %61
%62 = add nuw nsw i64 %12, 1
%63 = add nuw nsw i32 %13, 1
%64 = icmp eq i64 %62, %10
br i1 %64, label %65, label %11
65: ; preds = %59, %52, %50, %7, %2
%66 = phi i8** [ %5, %2 ], [ %5, %7 ], [ null, %50 ], [ null, %52 ], [ %5, %59 ]
ret i8** %66
}