#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 convCategorie(char chaine[], int IDCategorie) {
  switch (IDCategorie) {
  case 1:
    strcpy(chaine, "HighTech");
    break;
  case 2:
    strcpy(chaine, "Sport");
    break;
  case 3:
    strcpy(chaine, "Maison");
    break;
  case 4:
    strcpy(chaine, "Jouet");
    break;
  case 5:
    strcpy(chaine, "Automobile");
    break;
  default:;
  }
}


x86 assembly (clang, -O0):
<convCategorie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x4,%eax
ja     11b1 <convCategorie+0xa1>
mov    -0x18(%rbp),%rax
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11b6 <convCategorie+0xa6>
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11b6 <convCategorie+0xa6>
mov    -0x8(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11b6 <convCategorie+0xa6>
mov    -0x8(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11b6 <convCategorie+0xa6>
mov    -0x8(%rbp),%rdi
lea    0xe89(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11b6 <convCategorie+0xa6>
jmp    11b6 <convCategorie+0xa6>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convCategorie>:
add    $0xffffffff,%esi
cmp    $0x4,%esi
ja     112e <convCategorie+0x1e>
movslq %esi,%rax
lea    0xf06(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
jmp    1030 <strcpy@plt>
ret

LLVM IR (-O0):
@.str = [9 x i8] c"HighTech\00"
@.str.1 = [6 x i8] c"Sport\00"
@.str.2 = [7 x i8] c"Maison\00"
@.str.3 = [6 x i8] c"Jouet\00"
@.str.4 = [11 x i8] c"Automobile\00"
define void @convCategorie(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
switch i32 %5, label %21 [
i32 1, label %6
i32 2, label %9
i32 3, label %12
i32 4, label %15
i32 5, label %18
]
6: ; preds = %2
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %22
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %22
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = call i32 @strcpy(i8* %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %22
15: ; preds = %2
%16 = load i8*, i8** %3
%17 = call i32 @strcpy(i8* %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %22
18: ; preds = %2
%19 = load i8*, i8** %3
%20 = call i32 @strcpy(i8* %19, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
br label %22
21: ; preds = %2
br label %22
22: ; preds = %21, %18, %15, %12, %9, %6
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"HighTech\00"
@.str.1 = [6 x i8] c"Sport\00"
@.str.2 = [7 x i8] c"Maison\00"
@.str.3 = [6 x i8] c"Jouet\00"
@.str.4 = [11 x i8] c"Automobile\00"
@reltable.convCategorie = [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str to i64), i64 ptrtoint ([5 x i32]* @reltable.convCategorie to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.1 to i64), i64 ptrtoint ([5 x i32]* @reltable.convCategorie to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.2 to i64), i64 ptrtoint ([5 x i32]* @reltable.convCategorie to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.3 to i64), i64 ptrtoint ([5 x i32]* @reltable.convCategorie to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.4 to i64), i64 ptrtoint ([5 x i32]* @reltable.convCategorie to i64)) to i32)]
define void @convCategorie(i8* %0, i32 %1) {
%3 = add i32 %1, -1
%4 = icmp ult i32 %3, 5
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 ([5 x i32]* @reltable.convCategorie to i8*), i64 %7)
%9 = tail call i32 @strcpy(i8* %0, i8* %8)
br label %10
10: ; preds = %2, %5
ret void
}