#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 nom_token(int token, char *nom, char *valeur) {
  strcpy(nom, "symbole");
  if (token == 1)
    strcpy(valeur, "CHEVRON_FERMANT");
  else if (token == 2)
    strcpy(valeur, "DEBUT_BF");
  else if (token == 3)
    strcpy(valeur, "DEBUT_BO");
  else if (token == 4)
    strcpy(valeur, "CHAINE");
}


x86 assembly (clang, -O0):
<nom_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <strcpy@plt>
cmpl   $0x1,-0x4(%rbp)
jne    1152 <nom_token+0x42>
mov    -0x18(%rbp),%rdi
lea    0xec0(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11b9 <nom_token+0xa9>
cmpl   $0x2,-0x4(%rbp)
jne    1171 <nom_token+0x61>
mov    -0x18(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11b4 <nom_token+0xa4>
cmpl   $0x3,-0x4(%rbp)
jne    1190 <nom_token+0x80>
mov    -0x18(%rbp),%rdi
lea    0xe9b(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11af <nom_token+0x9f>
cmpl   $0x4,-0x4(%rbp)
jne    11aa <nom_token+0x9a>
mov    -0x18(%rbp),%rdi
lea    0xe85(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11af <nom_token+0x9f>
jmp    11b4 <nom_token+0xa4>
jmp    11b9 <nom_token+0xa9>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nom_token>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%rax
mov    %edi,%ebp
lea    0xede(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
add    $0xffffffff,%ebp
cmp    $0x3,%ebp
ja     1151 <nom_token+0x41>
movslq %ebp,%rax
lea    0xef8(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <strcpy@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"symbole\00"
@.str.1 = [16 x i8] c"CHEVRON_FERMANT\00"
@.str.2 = [9 x i8] c"DEBUT_BF\00"
@.str.3 = [9 x i8] c"DEBUT_BO\00"
@.str.4 = [7 x i8] c"CHAINE\00"
define void @nom_token(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load i8*, i8** %6
%13 = call i32 @strcpy(i8* %12, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %35
14: ; preds = %3
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 2
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i8*, i8** %6
%19 = call i32 @strcpy(i8* %18, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %34
20: ; preds = %14
%21 = load i32, i32* %4
%22 = icmp eq i32 %21, 3
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i8*, i8** %6
%25 = call i32 @strcpy(i8* %24, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %33
26: ; preds = %20
%27 = load i32, i32* %4
%28 = icmp eq i32 %27, 4
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = load i8*, i8** %6
%31 = call i32 @strcpy(i8* %30, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %32
32: ; preds = %29, %26
br label %33
33: ; preds = %32, %23
br label %34
34: ; preds = %33, %17
br label %35
35: ; preds = %34, %11
ret void
}

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