#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__ strcmp(char const *, char const *);
const char *aliasfunction(const char *name) {
  static const char *AliasTable[] = {
      "AllocDosObject", "AllocDosObjectTagList",
      "CreateNewProc",  "CreateNewProcTagList",
      "NewLoadSeg",     "NewLoadSegTagList",
      "System",         "SystemTagList",
  };
  unsigned int count;
  for (count = 0; count < sizeof AliasTable / sizeof AliasTable[0]; count++)
    if (strcmp(name, AliasTable[count]) == 0)
      return AliasTable[count + (count % 2 ? -1 : 1)];
  return NULL;
}


x86 assembly (clang, -O0):
<aliasfunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    $0x8,%rax
jae    1199 <aliasfunction+0x89>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
lea    0x2ef0(%rip),%rax
mov    (%rax,%rcx,8),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1186 <aliasfunction+0x76>
mov    -0x14(%rbp),%eax
mov    -0x14(%rbp),%esi
and    $0x1,%esi
mov    $0x1,%ecx
mov    $0xffffffff,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    %eax,%ecx
lea    0x2eb7(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
jmp    11a1 <aliasfunction+0x91>
jmp    118b <aliasfunction+0x7b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <aliasfunction+0x13>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aliasfunction>:
push   %rbx
mov    %rdi,%rbx
lea    0xf05(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11bd <aliasfunction+0xad>
lea    0xeff(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11c1 <aliasfunction+0xb1>
lea    0xefd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11c8 <aliasfunction+0xb8>
lea    0xef7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11cf <aliasfunction+0xbf>
lea    0xef8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11d6 <aliasfunction+0xc6>
lea    0xeef(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11dd <aliasfunction+0xcd>
lea    0xeed(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11e4 <aliasfunction+0xd4>
lea    0xee0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11eb <aliasfunction+0xdb>
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
jmp    11f0 <aliasfunction+0xe0>
mov    $0x1,%eax
jmp    11f0 <aliasfunction+0xe0>
mov    $0x2,%eax
jmp    11f0 <aliasfunction+0xe0>
mov    $0x3,%eax
jmp    11f0 <aliasfunction+0xe0>
mov    $0x4,%eax
jmp    11f0 <aliasfunction+0xe0>
mov    $0x5,%eax
jmp    11f0 <aliasfunction+0xe0>
mov    $0x6,%eax
jmp    11f0 <aliasfunction+0xe0>
mov    $0x7,%eax
mov    %eax,%ecx
and    $0x1,%ecx
neg    %ecx
sbb    %ecx,%ecx
or     $0x1,%ecx
add    %eax,%ecx
lea    0xdfb(%rip),%rdx
movslq (%rdx,%rcx,4),%rax
add    %rdx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@aliasfunction.AliasTable = internal global [8 x i8*] [i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i32 0, i32 0)]
@.str = [15 x i8] c"AllocDosObject\00"
@.str.1 = [22 x i8] c"AllocDosObjectTagList\00"
@.str.2 = [14 x i8] c"CreateNewProc\00"
@.str.3 = [21 x i8] c"CreateNewProcTagList\00"
@.str.4 = [11 x i8] c"NewLoadSeg\00"
@.str.5 = [18 x i8] c"NewLoadSegTagList\00"
@.str.6 = [7 x i8] c"System\00"
@.str.7 = [14 x i8] c"SystemTagList\00"
define i8* @aliasfunction(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %29, %1
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = icmp ult i64 %7, 8
br i1 %8, label %9, label %32
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds [8 x i8*], [8 x i8*]* @aliasfunction.AliasTable, i64 0, i64 %12
%14 = load i8*, i8** %13
%15 = call i64 @strcmp(i8* %10, i8* %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %28
17: ; preds = %9
%18 = load i32, i32* %4
%19 = load i32, i32* %4
%20 = urem i32 %19, 2
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 -1, i32 1
%24 = add i32 %18, %23
%25 = zext i32 %24 to i64
%26 = getelementptr inbounds [8 x i8*], [8 x i8*]* @aliasfunction.AliasTable, i64 0, i64 %25
%27 = load i8*, i8** %26
store i8* %27, i8** %2
br label %33
28: ; preds = %9
br label %29
29: ; preds = %28
%30 = load i32, i32* %4
%31 = add i32 %30, 1
store i32 %31, i32* %4
br label %5
32: ; preds = %5
store i8* null, i8** %2
br label %33
33: ; preds = %32, %17
%34 = load i8*, i8** %2
ret i8* %34
}

LLVM IR (-O2):
@reltable.aliasfunction = internal unnamed_addr constant [8 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str to i64), i64 ptrtoint ([8 x i32]* @reltable.aliasfunction to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.1 to i64), i64 ptrtoint ([8 x i32]* @reltable.aliasfunction to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.2 to i64), i64 ptrtoint ([8 x i32]* @reltable.aliasfunction to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.3 to i64), i64 ptrtoint ([8 x i32]* @reltable.aliasfunction to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.4 to i64), i64 ptrtoint ([8 x i32]* @reltable.aliasfunction to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.5 to i64), i64 ptrtoint ([8 x i32]* @reltable.aliasfunction to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.6 to i64), i64 ptrtoint ([8 x i32]* @reltable.aliasfunction to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.7 to i64), i64 ptrtoint ([8 x i32]* @reltable.aliasfunction to i64)) to i32)]
@.str = [15 x i8] c"AllocDosObject\00"
@.str.1 = [22 x i8] c"AllocDosObjectTagList\00"
@.str.2 = [14 x i8] c"CreateNewProc\00"
@.str.3 = [21 x i8] c"CreateNewProcTagList\00"
@.str.4 = [11 x i8] c"NewLoadSeg\00"
@.str.5 = [18 x i8] c"NewLoadSegTagList\00"
@.str.6 = [7 x i8] c"System\00"
@.str.7 = [14 x i8] c"SystemTagList\00"
define i8* @aliasfunction(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %31, %28, %25, %22, %19, %16, %13, %1
%5 = phi i32 [ 0, %1 ], [ 1, %13 ], [ 2, %16 ], [ 3, %19 ], [ 4, %22 ], [ 5, %25 ], [ 6, %28 ], [ 7, %31 ]
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 1, i32 -1
%9 = add nsw i32 %8, %5
%10 = zext i32 %9 to i64
%11 = shl i64 %10, 2
%12 = call i8* @llvm.load.relative.i64(i8* bitcast ([8 x i32]* @reltable.aliasfunction to i8*), i64 %11)
br label %34
13: ; preds = %1
%14 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %4, label %16
16: ; preds = %13
%17 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %4, label %19
19: ; preds = %16
%20 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %4, label %22
22: ; preds = %19
%23 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %4, label %25
25: ; preds = %22
%26 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %4, label %28
28: ; preds = %25
%29 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %4, label %31
31: ; preds = %28
%32 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %4, label %34
34: ; preds = %31, %4
%35 = phi i8* [ %12, %4 ], [ null, %31 ]
ret i8* %35
}