#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 */
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char **fizzBuzz(int n, int *returnSize) {
  int i, k;
  char **ans;
  *returnSize = n;
  if (n > 0) {
    ans = (char **)malloc(sizeof(char *) * n);
    for (i = 1; i <= n; i++) {
      k = i - 1;
      if (i % 15 == 0) {
        ans[k] = (char *)malloc(sizeof(char) * 9);
        strcpy(ans[k], "FizzBuzz");
      } else if (i % 5 == 0) {
        ans[k] = (char *)malloc(sizeof(char) * 5);
        strcpy(ans[k], "Buzz");
      } else if (i % 3 == 0) {
        ans[k] = (char *)malloc(sizeof(char) * 5);
        strcpy(ans[k], "Fizz");
      } else {
        ans[k] = (char *)malloc(sizeof(char) * 9);
        sprintf(ans[k], "%d", i);
      }
    }
  }
  return ans;
}


x86 assembly (clang, -O0):
<fizzBuzz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
cmpl   $0x0,-0x4(%rbp)
jle    12b5 <fizzBuzz+0x185>
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     12b0 <fizzBuzz+0x180>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11cb <fizzBuzz+0x9b>
mov    $0x9,%edi
call   1040 <malloc@plt>
mov    %rax,%rdx
mov    -0x20(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe3f(%rip),%rsi
call   1030 <strcpy@plt>
jmp    129d <fizzBuzz+0x16d>
mov    -0x14(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1215 <fizzBuzz+0xe5>
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,%rdx
mov    -0x20(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdf9(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1298 <fizzBuzz+0x168>
mov    -0x14(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    125f <fizzBuzz+0x12f>
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,%rdx
mov    -0x20(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdb4(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1293 <fizzBuzz+0x163>
mov    $0x9,%edi
call   1040 <malloc@plt>
mov    %rax,%rdx
mov    -0x20(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x14(%rbp),%edx
lea    0xd80(%rip),%rsi
call   1050 <sprintf@plt>
jmp    1298 <fizzBuzz+0x168>
jmp    129d <fizzBuzz+0x16d>
jmp    12a2 <fizzBuzz+0x172>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116c <fizzBuzz+0x3c>
jmp    12b5 <fizzBuzz+0x185>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fizzBuzz>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edi,(%rsi)
test   %edi,%edi
jle    124c <fizzBuzz+0x11c>
mov    %edi,%r15d
lea    0x0(,%r15,8),%edi
call   1040 <malloc@plt>
mov    %rax,%r14
add    $0x1,%r15d
mov    $0x1,%ebx
mov    $0xaaaaaaab,%r13d
mov    $0xcccccccd,%ebp
mov    $0x88888889,%r12d
jmp    11ab <fizzBuzz+0x7b>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x9,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%r14,%rbx,8)
mov    %rax,%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
je     124c <fizzBuzz+0x11c>
mov    %ebx,%eax
mov    %rax,%rcx
imul   %r12,%rcx
shr    $0x23,%rcx
mov    %ecx,%edx
shl    $0x4,%edx
sub    %edx,%ecx
add    %ebx,%ecx
je     1180 <fizzBuzz+0x50>
mov    %rax,%rcx
imul   %rbp,%rcx
shr    $0x22,%rcx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
add    %ebx,%ecx
je     1210 <fizzBuzz+0xe0>
imul   %r13,%rax
shr    $0x21,%rax
lea    (%rax,%rax,2),%eax
neg    %eax
add    %ebx,%eax
je     122e <fizzBuzz+0xfe>
mov    $0x9,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%r14,%rbx,8)
mov    %rax,%rdi
lea    0xe0d(%rip),%rsi
mov    %ebx,%edx
call   1050 <sprintf@plt>
jmp    119e <fizzBuzz+0x6e>
nopw   0x0(%rax,%rax,1)
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%r14,%rbx,8)
mov    %rax,%rdi
lea    0xddb(%rip),%rsi
jmp    1199 <fizzBuzz+0x69>
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%r14,%rbx,8)
mov    %rax,%rdi
lea    0xdc2(%rip),%rsi
jmp    1199 <fizzBuzz+0x69>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"FizzBuzz\00"
@.str.1 = [5 x i8] c"Buzz\00"
@.str.2 = [5 x i8] c"Fizz\00"
@.str.3 = [3 x i8] c"%d\00"
define i8** @fizzBuzz(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8**
store i32 %0, i32* %3
store i32* %1, i32** %4
%8 = load i32, i32* %3
%9 = load i32*, i32** %4
store i32 %8, i32* %9
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %97
12: ; preds = %2
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = mul i64 8, %14
%16 = trunc i64 %15 to i32
%17 = call i64 @malloc(i32 %16)
%18 = inttoptr i64 %17 to i8**
store i8** %18, i8*** %7
store i32 1, i32* %5
br label %19
19: ; preds = %93, %12
%20 = load i32, i32* %5
%21 = load i32, i32* %3
%22 = icmp sle i32 %20, %21
br i1 %22, label %23, label %96
23: ; preds = %19
%24 = load i32, i32* %5
%25 = sub nsw i32 %24, 1
store i32 %25, i32* %6
%26 = load i32, i32* %5
%27 = srem i32 %26, 15
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %42
29: ; preds = %23
%30 = call i64 @malloc(i32 9)
%31 = inttoptr i64 %30 to i8*
%32 = load i8**, i8*** %7
%33 = load i32, i32* %6
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8*, i8** %32, i64 %34
store i8* %31, i8** %35
%36 = load i8**, i8*** %7
%37 = load i32, i32* %6
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8*, i8** %36, i64 %38
%40 = load i8*, i8** %39
%41 = call i32 @strcpy(i8* %40, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %92
42: ; preds = %23
%43 = load i32, i32* %5
%44 = srem i32 %43, 5
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %59
46: ; preds = %42
%47 = call i64 @malloc(i32 5)
%48 = inttoptr i64 %47 to i8*
%49 = load i8**, i8*** %7
%50 = load i32, i32* %6
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8*, i8** %49, i64 %51
store i8* %48, i8** %52
%53 = load i8**, i8*** %7
%54 = load i32, i32* %6
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8*, i8** %53, i64 %55
%57 = load i8*, i8** %56
%58 = call i32 @strcpy(i8* %57, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %91
59: ; preds = %42
%60 = load i32, i32* %5
%61 = srem i32 %60, 3
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %76
63: ; preds = %59
%64 = call i64 @malloc(i32 5)
%65 = inttoptr i64 %64 to i8*
%66 = load i8**, i8*** %7
%67 = load i32, i32* %6
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i8*, i8** %66, i64 %68
store i8* %65, i8** %69
%70 = load i8**, i8*** %7
%71 = load i32, i32* %6
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds i8*, i8** %70, i64 %72
%74 = load i8*, i8** %73
%75 = call i32 @strcpy(i8* %74, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %90
76: ; preds = %59
%77 = call i64 @malloc(i32 9)
%78 = inttoptr i64 %77 to i8*
%79 = load i8**, i8*** %7
%80 = load i32, i32* %6
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i8*, i8** %79, i64 %81
store i8* %78, i8** %82
%83 = load i8**, i8*** %7
%84 = load i32, i32* %6
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds i8*, i8** %83, i64 %85
%87 = load i8*, i8** %86
%88 = load i32, i32* %5
%89 = call i32 @sprintf(i8* %87, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %88)
br label %90
90: ; preds = %76, %63
br label %91
91: ; preds = %90, %46
br label %92
92: ; preds = %91, %29
br label %93
93: ; preds = %92
%94 = load i32, i32* %5
%95 = add nsw i32 %94, 1
store i32 %95, i32* %5
br label %19
96: ; preds = %19
br label %97
97: ; preds = %96, %2
%98 = load i8**, i8*** %7
ret i8** %98
}

LLVM IR (-O2):
@.str = [9 x i8] c"FizzBuzz\00"
@.str.1 = [5 x i8] c"Buzz\00"
@.str.2 = [5 x i8] c"Fizz\00"
@.str.3 = [3 x i8] c"%d\00"
define i8** @fizzBuzz(i32 %0, i32* nocapture writeonly %1) {
store i32 %0, i32* %1
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %45
4: ; preds = %2
%5 = shl i32 %0, 3
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8**
%8 = add nuw i32 %0, 1
%9 = zext i32 %8 to i64
br label %10
10: ; preds = %4, %42
%11 = phi i64 [ 1, %4 ], [ %43, %42 ]
%12 = add nsw i64 %11, -1
%13 = trunc i64 %11 to i32
%14 = urem i32 %13, 15
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %10
%17 = tail call i64 @malloc(i32 9)
%18 = inttoptr i64 %17 to i8*
%19 = getelementptr inbounds i8*, i8** %7, i64 %12
store i8* %18, i8** %19
%20 = tail call i32 @strcpy(i8* %18, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %42
21: ; preds = %10
%22 = urem i32 %13, 5
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %29
24: ; preds = %21
%25 = tail call i64 @malloc(i32 5)
%26 = inttoptr i64 %25 to i8*
%27 = getelementptr inbounds i8*, i8** %7, i64 %12
store i8* %26, i8** %27
%28 = tail call i32 @strcpy(i8* %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %42
29: ; preds = %21
%30 = urem i32 %13, 3
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %37
32: ; preds = %29
%33 = tail call i64 @malloc(i32 5)
%34 = inttoptr i64 %33 to i8*
%35 = getelementptr inbounds i8*, i8** %7, i64 %12
store i8* %34, i8** %35
%36 = tail call i32 @strcpy(i8* %34, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %42
37: ; preds = %29
%38 = tail call i64 @malloc(i32 9)
%39 = inttoptr i64 %38 to i8*
%40 = getelementptr inbounds i8*, i8** %7, i64 %12
store i8* %39, i8** %40
%41 = tail call i32 @sprintf(i8* dereferenceable(1) %39, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %13)
br label %42
42: ; preds = %16, %32, %37, %24
%43 = add nuw nsw i64 %11, 1
%44 = icmp eq i64 %43, %9
br i1 %44, label %45, label %10
45: ; preds = %42, %2
%46 = phi i8** [ undef, %2 ], [ %7, %42 ]
ret i8** %46
}