#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 */
int /*<<< orphan*/ strcpy(char *, char *);
int convTypeCodeToAttributeType(int typeCode, char *attributeType) {
  if (typeCode == 1)
    strcpy(attributeType, "INTEGER");
  else if (typeCode == 2)
    strcpy(attributeType, "UNSIGNED_INTEGER");
  else if (typeCode == 3)
    strcpy(attributeType, "HYPER");
  else if (typeCode == 4)
    strcpy(attributeType, "UNSIGNED_HYPER");
  else if (typeCode == 5)
    strcpy(attributeType, "FLOAT");
  else if (typeCode == 6)
    strcpy(attributeType, "DOUBLE");
  else if (typeCode == 7)
    strcpy(attributeType, "BYTE_ARRAY");
  else if (typeCode == 8)
    strcpy(attributeType, "UTF8_ARRAY");
  return (0);
}


x86 assembly (clang, -O0):
<convTypeCodeToAttributeType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    113e <convTypeCodeToAttributeType+0x2e>
mov    -0x10(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1235 <convTypeCodeToAttributeType+0x125>
cmpl   $0x2,-0x4(%rbp)
jne    115d <convTypeCodeToAttributeType+0x4d>
mov    -0x10(%rbp),%rdi
lea    0xead(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1230 <convTypeCodeToAttributeType+0x120>
cmpl   $0x3,-0x4(%rbp)
jne    117c <convTypeCodeToAttributeType+0x6c>
mov    -0x10(%rbp),%rdi
lea    0xea8(%rip),%rsi
call   1030 <strcpy@plt>
jmp    122b <convTypeCodeToAttributeType+0x11b>
cmpl   $0x4,-0x4(%rbp)
jne    119b <convTypeCodeToAttributeType+0x8b>
mov    -0x10(%rbp),%rdi
lea    0xe80(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1226 <convTypeCodeToAttributeType+0x116>
cmpl   $0x5,-0x4(%rbp)
jne    11ba <convTypeCodeToAttributeType+0xaa>
mov    -0x10(%rbp),%rdi
lea    0xe70(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1221 <convTypeCodeToAttributeType+0x111>
cmpl   $0x6,-0x4(%rbp)
jne    11d9 <convTypeCodeToAttributeType+0xc9>
mov    -0x10(%rbp),%rdi
lea    0xe57(%rip),%rsi
call   1030 <strcpy@plt>
jmp    121c <convTypeCodeToAttributeType+0x10c>
cmpl   $0x7,-0x4(%rbp)
jne    11f8 <convTypeCodeToAttributeType+0xe8>
mov    -0x10(%rbp),%rdi
lea    0xe3f(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1217 <convTypeCodeToAttributeType+0x107>
cmpl   $0x8,-0x4(%rbp)
jne    1212 <convTypeCodeToAttributeType+0x102>
mov    -0x10(%rbp),%rdi
lea    0xe2b(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1217 <convTypeCodeToAttributeType+0x107>
jmp    121c <convTypeCodeToAttributeType+0x10c>
jmp    1221 <convTypeCodeToAttributeType+0x111>
jmp    1226 <convTypeCodeToAttributeType+0x116>
jmp    122b <convTypeCodeToAttributeType+0x11b>
jmp    1230 <convTypeCodeToAttributeType+0x120>
jmp    1235 <convTypeCodeToAttributeType+0x125>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convTypeCodeToAttributeType>:
add    $0xffffffff,%edi
cmp    $0x7,%edi
ja     1139 <convTypeCodeToAttributeType+0x29>
push   %rax
movslq %edi,%rax
lea    0xf21(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"INTEGER\00"
@.str.1 = [17 x i8] c"UNSIGNED_INTEGER\00"
@.str.2 = [6 x i8] c"HYPER\00"
@.str.3 = [15 x i8] c"UNSIGNED_HYPER\00"
@.str.4 = [6 x i8] c"FLOAT\00"
@.str.5 = [7 x i8] c"DOUBLE\00"
@.str.6 = [11 x i8] c"BYTE_ARRAY\00"
@.str.7 = [11 x i8] c"UTF8_ARRAY\00"
define i32 @convTypeCodeToAttributeType(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %59
10: ; preds = %2
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i8*, i8** %4
%15 = call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %58
16: ; preds = %10
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 3
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i8*, i8** %4
%21 = call i32 @strcpy(i8* %20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %57
22: ; preds = %16
%23 = load i32, i32* %3
%24 = icmp eq i32 %23, 4
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load i8*, i8** %4
%27 = call i32 @strcpy(i8* %26, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %56
28: ; preds = %22
%29 = load i32, i32* %3
%30 = icmp eq i32 %29, 5
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = load i8*, i8** %4
%33 = call i32 @strcpy(i8* %32, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %55
34: ; preds = %28
%35 = load i32, i32* %3
%36 = icmp eq i32 %35, 6
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = load i8*, i8** %4
%39 = call i32 @strcpy(i8* %38, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %54
40: ; preds = %34
%41 = load i32, i32* %3
%42 = icmp eq i32 %41, 7
br i1 %42, label %43, label %46
43: ; preds = %40
%44 = load i8*, i8** %4
%45 = call i32 @strcpy(i8* %44, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
br label %53
46: ; preds = %40
%47 = load i32, i32* %3
%48 = icmp eq i32 %47, 8
br i1 %48, label %49, label %52
49: ; preds = %46
%50 = load i8*, i8** %4
%51 = call i32 @strcpy(i8* %50, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
br label %52
52: ; preds = %49, %46
br label %53
53: ; preds = %52, %43
br label %54
54: ; preds = %53, %37
br label %55
55: ; preds = %54, %31
br label %56
56: ; preds = %55, %25
br label %57
57: ; preds = %56, %19
br label %58
58: ; preds = %57, %13
br label %59
59: ; preds = %58, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"INTEGER\00"
@.str.1 = [17 x i8] c"UNSIGNED_INTEGER\00"
@.str.2 = [6 x i8] c"HYPER\00"
@.str.3 = [15 x i8] c"UNSIGNED_HYPER\00"
@.str.4 = [6 x i8] c"FLOAT\00"
@.str.5 = [7 x i8] c"DOUBLE\00"
@.str.6 = [11 x i8] c"BYTE_ARRAY\00"
@.str.7 = [11 x i8] c"UTF8_ARRAY\00"
@reltable.convTypeCodeToAttributeType = [8 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str to i64), i64 ptrtoint ([8 x i32]* @reltable.convTypeCodeToAttributeType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @.str.1 to i64), i64 ptrtoint ([8 x i32]* @reltable.convTypeCodeToAttributeType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.2 to i64), i64 ptrtoint ([8 x i32]* @reltable.convTypeCodeToAttributeType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.3 to i64), i64 ptrtoint ([8 x i32]* @reltable.convTypeCodeToAttributeType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.4 to i64), i64 ptrtoint ([8 x i32]* @reltable.convTypeCodeToAttributeType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.5 to i64), i64 ptrtoint ([8 x i32]* @reltable.convTypeCodeToAttributeType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.6 to i64), i64 ptrtoint ([8 x i32]* @reltable.convTypeCodeToAttributeType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.7 to i64), i64 ptrtoint ([8 x i32]* @reltable.convTypeCodeToAttributeType to i64)) to i32)]
define i32 @convTypeCodeToAttributeType(i32 %0, i8* %1) {
%3 = add i32 %0, -1
%4 = icmp ult i32 %3, 8
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = sext i32 %3 to i64
%7 = shl i64 %6, 2
%8 = call i8* @llvm.load.relative.i64(i8* bitcast ([8 x i32]* @reltable.convTypeCodeToAttributeType to i8*), i64 %7)
%9 = tail call i32 @strcpy(i8* %1, i8* %8)
br label %10
10: ; preds = %2, %5
ret i32 0
}