#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 */
char *malloc(int);
int rand();
int /*<<< orphan*/ strcpy(char *, char *);
char *type() {
  int i;
  int j;
  int indexes[28];
  char *type;
  type = malloc(8 * sizeof(char));
  char *types[28] = {"GB",  "GC",  "GCA", "GCM", "GCC", "GE",  "GED",
                     "GFA", "GG",  "GH",  "GIT", "GJ",  "GLS", "GL",
                     "GMC", "GM",  "GMD", "GMU", "GPA", "GP",  "GS",
                     "GSS", "GTW", "GO",  "GU",  "G!",  "GAT", "GCS"};
  i = rand() % 28;
  strcpy(type, types[i]);
  return type;
}


x86 assembly (clang, -O0):
<type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x170,%rsp
mov    $0x8,%edi
call   1050 <malloc@plt>
mov    %rax,-0x88(%rbp)
lea    -0x170(%rbp),%rdi
lea    0x2bd6(%rip),%rsi
mov    $0xe0,%edx
call   1040 <memcpy@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x1c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x88(%rbp),%rdi
movslq -0x4(%rbp),%rax
mov    -0x170(%rbp,%rax,8),%rsi
ff
call   1030 <strcpy@plt>
mov    -0x88(%rbp),%rax
add    $0x170,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<type>:
push   %rbx
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x4,%ecx
add    %edx,%ecx
lea    (%rcx,%rcx,8),%edx
lea    (%rdx,%rdx,2),%edx
add    %ecx,%edx
sub    %edx,%eax
cltq
lea    0xef3(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"GB\00"
@.str.1 = [3 x i8] c"GC\00"
@.str.2 = [4 x i8] c"GCA\00"
@.str.3 = [4 x i8] c"GCM\00"
@.str.4 = [4 x i8] c"GCC\00"
@.str.5 = [3 x i8] c"GE\00"
@.str.6 = [4 x i8] c"GED\00"
@.str.7 = [4 x i8] c"GFA\00"
@.str.8 = [3 x i8] c"GG\00"
@.str.9 = [3 x i8] c"GH\00"
@.str.10 = [4 x i8] c"GIT\00"
@.str.11 = [3 x i8] c"GJ\00"
@.str.12 = [4 x i8] c"GLS\00"
@.str.13 = [3 x i8] c"GL\00"
@.str.14 = [4 x i8] c"GMC\00"
@.str.15 = [3 x i8] c"GM\00"
@.str.16 = [4 x i8] c"GMD\00"
@.str.17 = [4 x i8] c"GMU\00"
@.str.18 = [4 x i8] c"GPA\00"
@.str.19 = [3 x i8] c"GP\00"
@.str.20 = [3 x i8] c"GS\00"
@.str.21 = [4 x i8] c"GSS\00"
@.str.22 = [4 x i8] c"GTW\00"
@.str.23 = [3 x i8] c"GO\00"
@.str.24 = [3 x i8] c"GU\00"
@.str.25 = [3 x i8] c"G!\00"
@.str.26 = [4 x i8] c"GAT\00"
@.str.27 = [4 x i8] c"GCS\00"
@__const.type.types = [28 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.27, i32 0, i32 0)]
define i8* @type() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [28 x i32]
%4 = alloca i8*
%5 = alloca [28 x i8*]
%6 = call i8* @malloc(i32 8)
store i8* %6, i8** %4
%7 = bitcast [28 x i8*]* %5 to i8*
%8 = call i32 (...) @rand()
%9 = srem i32 %8, 28
store i32 %9, i32* %1
%10 = load i8*, i8** %4
%11 = load i32, i32* %1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [28 x i8*], [28 x i8*]* %5, i64 0, i64 %12
%14 = load i8*, i8** %13
%15 = call i32 @strcpy(i8* %10, i8* %14)
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"GB\00"
@.str.1 = [3 x i8] c"GC\00"
@.str.2 = [4 x i8] c"GCA\00"
@.str.3 = [4 x i8] c"GCM\00"
@.str.4 = [4 x i8] c"GCC\00"
@.str.5 = [3 x i8] c"GE\00"
@.str.6 = [4 x i8] c"GED\00"
@.str.7 = [4 x i8] c"GFA\00"
@.str.8 = [3 x i8] c"GG\00"
@.str.9 = [3 x i8] c"GH\00"
@.str.10 = [4 x i8] c"GIT\00"
@.str.11 = [3 x i8] c"GJ\00"
@.str.12 = [4 x i8] c"GLS\00"
@.str.13 = [3 x i8] c"GL\00"
@.str.14 = [4 x i8] c"GMC\00"
@.str.15 = [3 x i8] c"GM\00"
@.str.16 = [4 x i8] c"GMD\00"
@.str.17 = [4 x i8] c"GMU\00"
@.str.18 = [4 x i8] c"GPA\00"
@.str.19 = [3 x i8] c"GP\00"
@.str.20 = [3 x i8] c"GS\00"
@.str.21 = [4 x i8] c"GSS\00"
@.str.22 = [4 x i8] c"GTW\00"
@.str.23 = [3 x i8] c"GO\00"
@.str.24 = [3 x i8] c"GU\00"
@.str.25 = [3 x i8] c"G!\00"
@.str.26 = [4 x i8] c"GAT\00"
@.str.27 = [4 x i8] c"GCS\00"
@reltable.type = [28 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.2 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.3 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.4 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.5 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.6 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.7 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.8 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.9 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.10 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.11 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.12 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.13 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.14 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.15 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.16 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.17 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.18 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.19 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.20 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.21 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.22 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.23 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.24 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.25 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.26 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.27 to i64), i64 ptrtoint ([28 x i32]* @reltable.type to i64)) to i32)]
define i8* @type() {
%1 = tail call dereferenceable_or_null(8) i8* @malloc(i32 8)
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 28
%4 = sext i32 %3 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([28 x i32]* @reltable.type to i8*), i64 %5)
%7 = tail call i32 @strcpy(i8* %1, i8* %6)
ret i8* %1
}