#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 int32_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(int);
int /*<<< orphan*/ stderr;
void initializeStrArray(char ***array) {
  *array = malloc((256) * sizeof(sizeof(char *)));
  if (!(*array)) {
    fprintf(stderr, ("Unable to allocate memory for book move string array."));
    exit(EXIT_FAILURE);
  };
  for (int32_t i = 0; i < 256; i++) {
    (*array)[i] = malloc((8) * sizeof(sizeof(char)));
    if (!((*array)[i])) {
      fprintf(stderr, ("Unable to allocate memory for book move string."));
      exit(EXIT_FAILURE);
    };
  }
}


x86 assembly (clang, -O0):
<initializeStrArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x800,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1181 <initializeStrArray+0x51>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xe92(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x100,-0xc(%rbp)
jge    11fd <initializeStrArray+0xcd>
mov    $0x40,%edi
call   1040 <malloc@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
jne    11ea <initializeStrArray+0xba>
mov    0x2e12(%rip),%rax
mov    (%rax),%edi
lea    0xe5f(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2df5(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
jmp    11ef <initializeStrArray+0xbf>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1188 <initializeStrArray+0x58>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initializeStrArray>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0x800,%edi
call   1040 <malloc@plt>
mov    %rax,(%r14)
test   %rax,%rax
je     119e <initializeStrArray+0x6e>
mov    %rax,%r15
xor    %ebx,%ebx
nop
mov    $0x40,%edi
call   1040 <malloc@plt>
mov    %rax,(%r15,%rbx,8)
mov    (%r14),%r15
cmpq   $0x0,(%r15,%rbx,8)
je     117b <initializeStrArray+0x4b>
add    $0x1,%rbx
cmp    $0x100,%rbx
jne    1150 <initializeStrArray+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    0x2e3b(%rip),%rax
mov    (%rax),%edi
lea    0xe52(%rip),%rsi
jmp    118b <initializeStrArray+0x5b>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"Unable to allocate memory for book move string array.\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [48 x i8] c"Unable to allocate memory for book move string.\00"
define void @initializeStrArray(i8*** %0) {
%2 = alloca i8***
%3 = alloca i32
store i8*** %0, i8**** %2
%4 = call i8* @malloc(i32 2048)
%5 = bitcast i8* %4 to i8**
%6 = load i8***, i8**** %2
store i8** %5, i8*** %6
%7 = load i8***, i8**** %2
%8 = load i8**, i8*** %7
%9 = icmp ne i8** %8, null
br i1 %9, label %15, label %10
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %1
store i32 0, i32* %3
br label %16
16: ; preds = %39, %15
%17 = load i32, i32* %3
%18 = icmp slt i32 %17, 256
br i1 %18, label %19, label %42
19: ; preds = %16
%20 = call i8* @malloc(i32 64)
%21 = load i8***, i8**** %2
%22 = load i8**, i8*** %21
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %22, i64 %24
store i8* %20, i8** %25
%26 = load i8***, i8**** %2
%27 = load i8**, i8*** %26
%28 = load i32, i32* %3
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8*, i8** %27, i64 %29
%31 = load i8*, i8** %30
%32 = icmp ne i8* %31, null
br i1 %32, label %38, label %33
33: ; preds = %19
%34 = load i32, i32* @stderr
%35 = call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%36 = load i32, i32* @EXIT_FAILURE
%37 = call i32 @exit(i32 %36)
unreachable
38: ; preds = %19
br label %39
39: ; preds = %38
%40 = load i32, i32* %3
%41 = add nsw i32 %40, 1
store i32 %41, i32* %3
br label %16
42: ; preds = %16
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"Unable to allocate memory for book move string array.\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [48 x i8] c"Unable to allocate memory for book move string.\00"
define void @initializeStrArray(i8*** nocapture %0) {
%2 = tail call dereferenceable_or_null(2048) i8* @malloc(i32 2048)
%3 = bitcast i8*** %0 to i8**
store i8* %2, i8** %3
%4 = icmp eq i8* %2, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = bitcast i8* %2 to i8**
br label %16
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = tail call i32 @exit(i32 %10)
unreachable
12: ; preds = %16
%13 = add nuw nsw i64 %18, 1
%14 = icmp eq i64 %13, 256
br i1 %14, label %15, label %16
15: ; preds = %12
ret void
16: ; preds = %5, %12
%17 = phi i8** [ %6, %5 ], [ %21, %12 ]
%18 = phi i64 [ 0, %5 ], [ %13, %12 ]
%19 = tail call dereferenceable_or_null(64) i8* @malloc(i32 64)
%20 = getelementptr inbounds i8*, i8** %17, i64 %18
store i8* %19, i8** %20
%21 = load i8**, i8*** %0
%22 = getelementptr inbounds i8*, i8** %21, i64 %18
%23 = load i8*, i8** %22
%24 = icmp eq i8* %23, null
br i1 %24, label %25, label %12
25: ; preds = %16
%26 = load i32, i32* @stderr
%27 = tail call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%28 = load i32, i32* @EXIT_FAILURE
%29 = tail call i32 @exit(i32 %28)
unreachable
}