#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 *);
char *sHybridName(int iHybrid, char *sName) {
  switch (iHybrid) {
  case -1:
    strcpy(sName, "undefined");
    break;
  case 1:
    strcpy(sName, "sp1");
    break;
  case 2:
    strcpy(sName, "sp2");
    break;
  case 3:
    strcpy(sName, "sp3");
    break;
  case 0:
  default:
    strcpy(sName, "unknown");
    break;
  }
  return (sName);
}


x86 assembly (clang, -O0):
<sHybridName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x4,%eax
ja     11a1 <sHybridName+0x91>
mov    -0x18(%rbp),%rax
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11b1 <sHybridName+0xa1>
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11b1 <sHybridName+0xa1>
mov    -0x10(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11b1 <sHybridName+0xa1>
mov    -0x10(%rbp),%rdi
lea    0xe94(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11b1 <sHybridName+0xa1>
jmp    11a1 <sHybridName+0x91>
mov    -0x10(%rbp),%rdi
lea    0xe7e(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sHybridName>:
push   %rbx
mov    %rsi,%rbx
add    $0x1,%edi
cmp    $0x4,%edi
ja     112f <sHybridName+0x1f>
movslq %edi,%rax
lea    0xefa(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
jmp    1136 <sHybridName+0x26>
lea    0xee0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"undefined\00"
@.str.1 = [4 x i8] c"sp1\00"
@.str.2 = [4 x i8] c"sp2\00"
@.str.3 = [4 x i8] c"sp3\00"
@.str.4 = [8 x i8] c"unknown\00"
define i8* @sHybridName(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
switch i32 %5, label %19 [
i32 -1, label %6
i32 1, label %9
i32 2, label %12
i32 3, label %15
i32 0, label %18
]
6: ; preds = %2
%7 = load i8*, i8** %4
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %22
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %22
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = call i32 @strcpy(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %22
15: ; preds = %2
%16 = load i8*, i8** %4
%17 = call i32 @strcpy(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %22
18: ; preds = %2
br label %19
19: ; preds = %2, %18
%20 = load i8*, i8** %4
%21 = call i32 @strcpy(i8* %20, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
br label %22
22: ; preds = %19, %15, %12, %9, %6
%23 = load i8*, i8** %4
ret i8* %23
}

LLVM IR (-O2):
@.str = [10 x i8] c"undefined\00"
@.str.1 = [4 x i8] c"sp1\00"
@.str.2 = [4 x i8] c"sp2\00"
@.str.3 = [4 x i8] c"sp3\00"
@.str.4 = [8 x i8] c"unknown\00"
@reltable.sHybridName = [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str to i64), i64 ptrtoint ([5 x i32]* @reltable.sHybridName to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.4 to i64), i64 ptrtoint ([5 x i32]* @reltable.sHybridName to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.1 to i64), i64 ptrtoint ([5 x i32]* @reltable.sHybridName to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.2 to i64), i64 ptrtoint ([5 x i32]* @reltable.sHybridName to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.3 to i64), i64 ptrtoint ([5 x i32]* @reltable.sHybridName to i64)) to i32)]
define i8* @sHybridName(i32 %0, i8* returned %1) {
%3 = add i32 %0, 1
%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.sHybridName 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.4, i64 0, i64 0), %2 ]
%11 = tail call i32 @strcpy(i8* %1, i8* %10)
ret i8* %1
}