#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 LireParametre(char *, char *, char *);
int atoi(char *);
int IdentifiantBoutonPlosible(int identifiantBouton) {
  char nbrMax[2];
  int indexMax;
  if (LireParametre("switchmanager.config", "NombreBouton", nbrMax) != 200) {
    return 509;
  }
  indexMax = atoi(nbrMax);
  if (identifiantBouton > indexMax) {
    return 416;
  }
  if (identifiantBouton < 1) {
    return 403;
  }
  return 200;
}


x86 assembly (clang, -O0):
<IdentifiantBoutonPlosible>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    -0xa(%rbp),%rdx
lea    0xeca(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1040 <LireParametre@plt>
cmp    $0xc8,%eax
je     1159 <IdentifiantBoutonPlosible+0x39>
movl   $0x1fd,-0x4(%rbp)
jmp    119a <IdentifiantBoutonPlosible+0x7a>
lea    -0xa(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    117d <IdentifiantBoutonPlosible+0x5d>
movl   $0x1a0,-0x4(%rbp)
jmp    119a <IdentifiantBoutonPlosible+0x7a>
cmpl   $0x1,-0x8(%rbp)
jge    1193 <IdentifiantBoutonPlosible+0x73>
movl   $0x193,-0x4(%rbp)
jmp    119a <IdentifiantBoutonPlosible+0x7a>
movl   $0xc8,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IdentifiantBoutonPlosible>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xed2(%rip),%rdi
lea    0xee0(%rip),%rsi
lea    0xe(%rsp),%rdx
call   1040 <LireParametre@plt>
mov    %eax,%ecx
mov    $0x1fd,%eax
cmp    $0xc8,%ecx
jne    1172 <IdentifiantBoutonPlosible+0x52>
lea    0xe(%rsp),%rdi
call   1030 <atoi@plt>
mov    %eax,%ecx
mov    $0x1a0,%eax
cmp    %ebx,%ecx
jl     1172 <IdentifiantBoutonPlosible+0x52>
test   %ebx,%ebx
mov    $0x193,%ecx
mov    $0xc8,%eax
cmovle %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"switchmanager.config\00"
@.str.1 = [13 x i8] c"NombreBouton\00"
define i32 @IdentifiantBoutonPlosible(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [2 x i8]
%5 = alloca i32
store i32 %0, i32* %3
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%7 = call i32 @LireParametre(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = icmp ne i32 %7, 200
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 509, i32* %2
br label %22
10: ; preds = %1
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%12 = call i32 @atoi(i8* %11)
store i32 %12, i32* %5
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %10
store i32 416, i32* %2
br label %22
17: ; preds = %10
%18 = load i32, i32* %3
%19 = icmp slt i32 %18, 1
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 403, i32* %2
br label %22
21: ; preds = %17
store i32 200, i32* %2
br label %22
22: ; preds = %21, %20, %16, %9
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
@.str = [21 x i8] c"switchmanager.config\00"
@.str.1 = [13 x i8] c"NombreBouton\00"
define i32 @IdentifiantBoutonPlosible(i32 %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = call i32 @LireParametre(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = icmp eq i32 %4, 200
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = call i32 @atoi(i8* %3)
%8 = icmp slt i32 %7, %0
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = icmp slt i32 %0, 1
%11 = select i1 %10, i32 403, i32 200
br label %12
12: ; preds = %9, %6, %1
%13 = phi i32 [ 509, %1 ], [ 416, %6 ], [ %11, %9 ]
ret i32 %13
}