#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 *);
void get_bunch_name(int type, char typename[25]) {
  if (type == 3)
    strcpy(typename, "polyhedron");
  else if (type == 5)
    strcpy(typename, "contours");
  else if (type == 6)
    strcpy(typename, "normals");
  else if (type == 2)
    strcpy(typename, "sticks");
  else if (type == 4)
    strcpy(typename, "density");
  else
    strcpy(typename, "unknown");
}


x86 assembly (clang, -O0):
<get_bunch_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    113e <get_bunch_name+0x2e>
mov    -0x10(%rbp),%rdi
lea    0xecc(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11de <get_bunch_name+0xce>
cmpl   $0x5,-0x4(%rbp)
jne    115d <get_bunch_name+0x4d>
mov    -0x10(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11d9 <get_bunch_name+0xc9>
cmpl   $0x6,-0x4(%rbp)
jne    117c <get_bunch_name+0x6c>
mov    -0x10(%rbp),%rdi
lea    0xea2(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11d4 <get_bunch_name+0xc4>
cmpl   $0x2,-0x4(%rbp)
jne    119b <get_bunch_name+0x8b>
mov    -0x10(%rbp),%rdi
lea    0xe8b(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11cf <get_bunch_name+0xbf>
cmpl   $0x4,-0x4(%rbp)
jne    11ba <get_bunch_name+0xaa>
mov    -0x10(%rbp),%rdi
lea    0xe73(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11ca <get_bunch_name+0xba>
mov    -0x10(%rbp),%rdi
lea    0xe66(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11cf <get_bunch_name+0xbf>
jmp    11d4 <get_bunch_name+0xc4>
jmp    11d9 <get_bunch_name+0xc9>
jmp    11de <get_bunch_name+0xce>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bunch_name>:
mov    %rsi,%rax
add    $0xfffffffe,%edi
cmp    $0x4,%edi
ja     1134 <get_bunch_name+0x24>
movslq %edi,%rcx
lea    0xf0f(%rip),%rdx
movslq (%rdx,%rcx,4),%rsi
add    %rdx,%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>
lea    0xef0(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"polyhedron\00"
@.str.1 = [9 x i8] c"contours\00"
@.str.2 = [8 x i8] c"normals\00"
@.str.3 = [7 x i8] c"sticks\00"
@.str.4 = [8 x i8] c"density\00"
@.str.5 = [8 x i8] c"unknown\00"
define void @get_bunch_name(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, 3
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %41
10: ; preds = %2
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 5
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i8*, i8** %4
%15 = call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %40
16: ; preds = %10
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 6
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i8*, i8** %4
%21 = call i32 @strcpy(i8* %20, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %39
22: ; preds = %16
%23 = load i32, i32* %3
%24 = icmp eq i32 %23, 2
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load i8*, i8** %4
%27 = call i32 @strcpy(i8* %26, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %38
28: ; preds = %22
%29 = load i32, i32* %3
%30 = icmp eq i32 %29, 4
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = load i8*, i8** %4
%33 = call i32 @strcpy(i8* %32, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
br label %37
34: ; preds = %28
%35 = load i8*, i8** %4
%36 = call i32 @strcpy(i8* %35, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
br label %37
37: ; preds = %34, %31
br label %38
38: ; preds = %37, %25
br label %39
39: ; preds = %38, %19
br label %40
40: ; preds = %39, %13
br label %41
41: ; preds = %40, %7
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"polyhedron\00"
@.str.1 = [9 x i8] c"contours\00"
@.str.2 = [8 x i8] c"normals\00"
@.str.3 = [7 x i8] c"sticks\00"
@.str.4 = [8 x i8] c"density\00"
@.str.5 = [8 x i8] c"unknown\00"
@reltable.get_bunch_name = [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.3 to i64), i64 ptrtoint ([5 x i32]* @reltable.get_bunch_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str to i64), i64 ptrtoint ([5 x i32]* @reltable.get_bunch_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.4 to i64), i64 ptrtoint ([5 x i32]* @reltable.get_bunch_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.1 to i64), i64 ptrtoint ([5 x i32]* @reltable.get_bunch_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.2 to i64), i64 ptrtoint ([5 x i32]* @reltable.get_bunch_name to i64)) to i32)]
define void @get_bunch_name(i32 %0, i8* %1) {
%3 = add i32 %0, -2
%4 = icmp ult i32 %3, 5
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = sext i32 %3 to i64
%7 = shl i64 %6, 2
%8 = call i8* @llvm.load.relative.i64(i8* bitcast ([5 x i32]* @reltable.get_bunch_name to i8*), i64 %7)
br label %9
9: ; preds = %2, %5
%10 = phi i8* [ %8, %5 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), %2 ]
%11 = tail call i32 @strcpy(i8* %1, i8* %10)
ret void
}