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

/* Variables and functions */
int /*<<< orphan*/ fail(char *);
char **malloc(int);
char **allocateValuesP(uint32_t size) {
  char **result = malloc(sizeof(char *) * size);
  if (!result)
    fail("Hash_new: unable to allocate valuesP");
  for (unsigned i = 0; i < size; i++) {
    result[i] = NULL;
  }
  return result;
}


x86 assembly (clang, -O0):
<allocateValuesP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <allocateValuesP+0x35>
lea    0xeb0(%rip),%rdi
call   1030 <fail@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1185 <allocateValuesP+0x65>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
movq   $0x0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115c <allocateValuesP+0x3c>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocateValuesP>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x0(,%rbx,8),%edi
call   1050 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1169 <allocateValuesP+0x39>
test   %ebx,%ebx
je     115e <allocateValuesP+0x2e>
mov    %ebx,%edx
shl    $0x3,%rdx
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe90(%rip),%rdi
call   1030 <fail@plt>
test   %ebx,%ebx
jne    114e <allocateValuesP+0x1e>
jmp    115e <allocateValuesP+0x2e>

LLVM IR (-O0):
@.str = [37 x i8] c"Hash_new: unable to allocate valuesP\00"
define i8** @allocateValuesP(i32 %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = mul i64 8, %6
%8 = trunc i64 %7 to i32
%9 = call i8** @malloc(i32 %8)
store i8** %9, i8*** %3
%10 = load i8**, i8*** %3
%11 = icmp ne i8** %10, null
br i1 %11, label %14, label %12
12: ; preds = %1
%13 = call i32 @fail(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %1
store i32 0, i32* %4
br label %15
15: ; preds = %24, %14
%16 = load i32, i32* %4
%17 = load i32, i32* %2
%18 = icmp ult i32 %16, %17
br i1 %18, label %19, label %27
19: ; preds = %15
%20 = load i8**, i8*** %3
%21 = load i32, i32* %4
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds i8*, i8** %20, i64 %22
store i8* null, i8** %23
br label %24
24: ; preds = %19
%25 = load i32, i32* %4
%26 = add i32 %25, 1
store i32 %26, i32* %4
br label %15
27: ; preds = %15
%28 = load i8**, i8*** %3
ret i8** %28
}

LLVM IR (-O2):
@.str = [37 x i8] c"Hash_new: unable to allocate valuesP\00"
define noalias i8** @allocateValuesP(i32 %0) {
%2 = shl i32 %0, 3
%3 = tail call i8** @malloc(i32 %2)
%4 = bitcast i8** %3 to i8*
%5 = icmp eq i8** %3, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @fail(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = icmp eq i32 %0, 0
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = zext i32 %0 to i64
%12 = shl nuw nsw i64 %11, 3
br label %13
13: ; preds = %10, %8
ret i8** %3
}