#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 */
struct patternNodeHashEntry {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EnvExitRouter(void *, int /*<<< orphan*/);
scalar_t__ gm3(void *, int);
struct patternNodeHashEntry **CreatePatternHashTable(void *theEnv,
                                                     unsigned long tableSize) {
  unsigned long i;
  struct patternNodeHashEntry **theTable;
  theTable = (struct patternNodeHashEntry **)gm3(
      theEnv, sizeof(struct patternNodeHashEntry *) * tableSize);
  if (theTable == NULL)
    EnvExitRouter(theEnv, EXIT_FAILURE);
  for (i = 0; i < tableSize; i++)
    theTable[i] = NULL;
  return (theTable);
}


x86 assembly (clang, -O0):
<CreatePatternHashTable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%esi
call   1030 <gm3@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1164 <CreatePatternHashTable+0x44>
mov    -0x8(%rbp),%rdi
mov    0x2e83(%rip),%rax
mov    (%rax),%esi
call   1040 <EnvExitRouter@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    119b <CreatePatternHashTable+0x7b>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    116c <CreatePatternHashTable+0x4c>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreatePatternHashTable>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r15
lea    0x0(,%rsi,8),%esi
call   1030 <gm3@plt>
mov    %rax,%r14
test   %rax,%rax
je     116e <CreatePatternHashTable+0x3e>
test   %rbx,%rbx
je     1165 <CreatePatternHashTable+0x35>
shl    $0x3,%rbx
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1050 <memset@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    0x2e6b(%rip),%rax
mov    (%rax),%esi
mov    %r15,%rdi
call   1040 <EnvExitRouter@plt>
test   %rbx,%rbx
jne    1154 <CreatePatternHashTable+0x24>
jmp    1165 <CreatePatternHashTable+0x35>

LLVM IR (-O0):
%struct.patternNodeHashEntry = type { i32 }
@EXIT_FAILURE = global i32 0
define %struct.patternNodeHashEntry** @CreatePatternHashTable(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca %struct.patternNodeHashEntry**
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = mul i64 8, %8
%10 = trunc i64 %9 to i32
%11 = call i64 @gm3(i8* %7, i32 %10)
%12 = inttoptr i64 %11 to %struct.patternNodeHashEntry**
store %struct.patternNodeHashEntry** %12, %struct.patternNodeHashEntry*** %6
%13 = load %struct.patternNodeHashEntry**, %struct.patternNodeHashEntry*** %6
%14 = icmp eq %struct.patternNodeHashEntry** %13, null
br i1 %14, label %15, label %19
15: ; preds = %2
%16 = load i8*, i8** %3
%17 = load i32, i32* @EXIT_FAILURE
%18 = call i32 @EnvExitRouter(i8* %16, i32 %17)
br label %19
19: ; preds = %15, %2
store i64 0, i64* %5
br label %20
20: ; preds = %28, %19
%21 = load i64, i64* %5
%22 = load i64, i64* %4
%23 = icmp ult i64 %21, %22
br i1 %23, label %24, label %31
24: ; preds = %20
%25 = load %struct.patternNodeHashEntry**, %struct.patternNodeHashEntry*** %6
%26 = load i64, i64* %5
%27 = getelementptr inbounds %struct.patternNodeHashEntry*, %struct.patternNodeHashEntry** %25, i64 %26
store %struct.patternNodeHashEntry* null, %struct.patternNodeHashEntry** %27
br label %28
28: ; preds = %24
%29 = load i64, i64* %5
%30 = add i64 %29, 1
store i64 %30, i64* %5
br label %20
31: ; preds = %20
%32 = load %struct.patternNodeHashEntry**, %struct.patternNodeHashEntry*** %6
ret %struct.patternNodeHashEntry** %32
}

LLVM IR (-O2):
%struct.patternNodeHashEntry = type { i32 }
@EXIT_FAILURE = global i32 0
define %struct.patternNodeHashEntry** @CreatePatternHashTable(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl i32 %3, 3
%5 = tail call i64 @gm3(i8* %0, i32 %4)
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i64 %5, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @EnvExitRouter(i8* %0, i32 %9)
br label %11
11: ; preds = %8, %2
%12 = icmp eq i64 %1, 0
br i1 %12, label %15, label %13
13: ; preds = %11
%14 = shl nuw i64 %1, 3
br label %15
15: ; preds = %13, %11
%16 = inttoptr i64 %5 to %struct.patternNodeHashEntry**
ret %struct.patternNodeHashEntry** %16
}