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


x86 assembly (clang, -O0):
<vitesse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1158 <vitesse+0x28>
mov    $0x0,%al
call   1050 <vitesseNVE@plt>
jmp    11bf <vitesse+0x8f>
cmpl   $0x2,-0x4(%rbp)
jne    116e <vitesse+0x3e>
mov    $0x0,%al
call   1040 <vitesse_langevin@plt>
jmp    11ba <vitesse+0x8a>
cmpl   $0x3,-0x4(%rbp)
jne    1184 <vitesse+0x54>
mov    $0x0,%al
call   1030 <vitesseLNVT@plt>
jmp    11b5 <vitesse+0x85>
cmpl   $0x4,-0x4(%rbp)
jne    119a <vitesse+0x6a>
mov    $0x0,%al
call   1050 <vitesseNVE@plt>
jmp    11b0 <vitesse+0x80>
cmpl   $0x5,-0x4(%rbp)
jne    11ab <vitesse+0x7b>
mov    $0x0,%al
call   1050 <vitesseNVE@plt>
jmp    11b0 <vitesse+0x80>
jmp    11b5 <vitesse+0x85>
jmp    11ba <vitesse+0x8a>
jmp    11bf <vitesse+0x8f>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vitesse>:
push   %rax
add    $0xffffffff,%edi
cmp    $0x4,%edi
ja     1162 <vitesse+0x32>
lea    0xec0(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
xor    %eax,%eax
call   1050 <vitesseNVE@plt>
jmp    1162 <vitesse+0x32>
xor    %eax,%eax
call   1040 <vitesse_langevin@plt>
jmp    1162 <vitesse+0x32>
xor    %eax,%eax
call   1030 <vitesseLNVT@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @vitesse(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 (...) @vitesseNVE()
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 (...) @vitesse_langevin()
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 (...) @vitesseLNVT()
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 (...) @vitesseNVE()
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 (...) @vitesseNVE()
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 @vitesse(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 (...) @vitesseNVE()
br label %12
4: ; preds = %1
%5 = tail call i32 (...) @vitesse_langevin()
br label %12
6: ; preds = %1
%7 = tail call i32 (...) @vitesseLNVT()
br label %12
8: ; preds = %1
%9 = tail call i32 (...) @vitesseNVE()
br label %12
10: ; preds = %1
%11 = tail call i32 (...) @vitesseNVE()
br label %12
12: ; preds = %1, %4, %8, %10, %6, %2
ret i32 0
}