#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*/ createRandomString(char **, int);
char **malloc(int);
void createRandomStringArray(int length, int stringLength, char ***array) {
  char **createdArray = malloc(sizeof(char *) * length);
  int i = 0;
  for (i = 0; i < length; i++) {
    createRandomString(&createdArray[i], stringLength);
  }
  *array = createdArray;
}


x86 assembly (clang, -O0):
<createRandomStringArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1184 <createRandomStringArray+0x64>
mov    -0x18(%rbp),%rdi
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%esi
call   1040 <createRandomString@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1153 <createRandomStringArray+0x33>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createRandomStringArray>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %esi,%r12d
mov    %edi,%ebx
lea    0x0(,%rbx,8),%edi
call   1030 <malloc@plt>
mov    %rax,%r15
test   %ebx,%ebx
jle    1165 <createRandomStringArray+0x45>
mov    %ebx,%ebp
mov    %r15,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r12d,%esi
call   1040 <createRandomString@plt>
add    $0x8,%rbx
add    $0xffffffffffffffff,%rbp
jne    1150 <createRandomStringArray+0x30>
mov    %r15,(%r14)
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @createRandomStringArray(i32 %0, i32 %1, i8*** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8***
%7 = alloca i8**
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8*** %2, i8**** %6
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = mul i64 8, %10
%12 = trunc i64 %11 to i32
%13 = call i8** @malloc(i32 %12)
store i8** %13, i8*** %7
store i32 0, i32* %8
store i32 0, i32* %8
br label %14
14: ; preds = %25, %3
%15 = load i32, i32* %8
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %28
18: ; preds = %14
%19 = load i8**, i8*** %7
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
%23 = load i32, i32* %5
%24 = call i32 @createRandomString(i8** %22, i32 %23)
br label %25
25: ; preds = %18
%26 = load i32, i32* %8
%27 = add nsw i32 %26, 1
store i32 %27, i32* %8
br label %14
28: ; preds = %14
%29 = load i8**, i8*** %7
%30 = load i8***, i8**** %6
store i8** %29, i8*** %30
ret void
}

LLVM IR (-O2):
define void @createRandomStringArray(i32 %0, i32 %1, i8*** nocapture writeonly %2) {
%4 = shl i32 %0, 3
%5 = tail call i8** @malloc(i32 %4)
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %15
7: ; preds = %3
%8 = zext i32 %0 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ 0, %7 ], [ %13, %9 ]
%11 = getelementptr inbounds i8*, i8** %5, i64 %10
%12 = tail call i32 @createRandomString(i8** %11, i32 %1)
%13 = add nuw nsw i64 %10, 1
%14 = icmp eq i64 %13, %8
br i1 %14, label %15, label %9
15: ; preds = %9, %3
store i8** %5, i8*** %2
ret void
}