#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*/ positionLNVT();
int /*<<< orphan*/ positionNVE();
int position(int idmethode) {
  int erreur = 0;
  if (idmethode == 1) {
    positionNVE();
  } else if (idmethode == 2) {
    positionNVE();
  } else if (idmethode == 3) {
    positionLNVT();
  } else if (idmethode == 4) {
    positionNVE();
  } else if (idmethode == 5) {
    positionNVE();
  }
  return erreur;
}


x86 assembly (clang, -O0):
<position>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1148 <position+0x28>
mov    $0x0,%al
call   1030 <positionNVE@plt>
jmp    11af <position+0x8f>
cmpl   $0x2,-0x4(%rbp)
jne    115e <position+0x3e>
mov    $0x0,%al
call   1030 <positionNVE@plt>
jmp    11aa <position+0x8a>
cmpl   $0x3,-0x4(%rbp)
jne    1174 <position+0x54>
mov    $0x0,%al
call   1040 <positionLNVT@plt>
jmp    11a5 <position+0x85>
cmpl   $0x4,-0x4(%rbp)
jne    118a <position+0x6a>
mov    $0x0,%al
call   1030 <positionNVE@plt>
jmp    11a0 <position+0x80>
cmpl   $0x5,-0x4(%rbp)
jne    119b <position+0x7b>
mov    $0x0,%al
call   1030 <positionNVE@plt>
jmp    11a0 <position+0x80>
jmp    11a5 <position+0x85>
jmp    11aa <position+0x8a>
jmp    11af <position+0x8f>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<position>:
push   %rax
add    $0xffffffff,%edi
cmp    $0x4,%edi
ja     1149 <position+0x29>
lea    0xed0(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
xor    %eax,%eax
call   1030 <positionNVE@plt>
jmp    1149 <position+0x29>
xor    %eax,%eax
call   1040 <positionLNVT@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @position(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @positionNVE()
br label %32
8: ; preds = %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 2
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 (...) @positionNVE()
br label %31
13: ; preds = %8
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 3
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 (...) @positionLNVT()
br label %30
18: ; preds = %13
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 4
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 (...) @positionNVE()
br label %29
23: ; preds = %18
%24 = load i32, i32* %2
%25 = icmp eq i32 %24, 5
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 (...) @positionNVE()
br label %28
28: ; preds = %26, %23
br label %29
29: ; preds = %28, %21
br label %30
30: ; preds = %29, %16
br label %31
31: ; preds = %30, %11
br label %32
32: ; preds = %31, %6
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @position(i32 %0) {
switch i32 %0, label %12 [
i32 1, label %2
i32 2, label %4
i32 3, label %6
i32 4, label %8
i32 5, label %10
]
2: ; preds = %1
%3 = tail call i32 (...) @positionNVE()
br label %12
4: ; preds = %1
%5 = tail call i32 (...) @positionNVE()
br label %12
6: ; preds = %1
%7 = tail call i32 (...) @positionLNVT()
br label %12
8: ; preds = %1
%9 = tail call i32 (...) @positionNVE()
br label %12
10: ; preds = %1
%11 = tail call i32 (...) @positionNVE()
br label %12
12: ; preds = %1, %4, %8, %10, %6, %2
ret i32 0
}