#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 RetournerInformationConfig(char *, char *, char *);
int atoi(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ voCore_gpioInit(char *);
int initGPIO() {
  char resultat[512];
  int codeResultat;
  int nbrPort = 0;
  codeResultat = RetournerInformationConfig("NombreBouton", "1", resultat);
  if (codeResultat != 200) {
    return codeResultat;
  }
  nbrPort = atoi(resultat);
  for (int i = 0; i < nbrPort; i++) {
    sprintf(resultat, "%d", i);
    voCore_gpioInit(resultat);
    RetournerInformationConfig("NomBouton_", "Bouton", resultat);
    RetournerInformationConfig("ImageBouton_", "Light-BulbLeaf-icon.png",
                               resultat);
  }
  return 200;
}


x86 assembly (clang, -O0):
<initGPIO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
movl   $0x0,-0x218(%rbp)
lea    -0x210(%rbp),%rdx
lea    0xe9d(%rip),%rdi
lea    0xea3(%rip),%rsi
call   1040 <RetournerInformationConfig@plt>
mov    %eax,-0x214(%rbp)
cmpl   $0xc8,-0x214(%rbp)
je     1193 <initGPIO+0x53>
mov    -0x214(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1235 <initGPIO+0xf5>
lea    -0x210(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x218(%rbp)
movl   $0x0,-0x21c(%rbp)
mov    -0x21c(%rbp),%eax
cmp    -0x218(%rbp),%eax
jge    122e <initGPIO+0xee>
lea    -0x210(%rbp),%rdi
mov    -0x21c(%rbp),%edx
lea    0xe3a(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x210(%rbp),%rdi
call   1030 <voCore_gpioInit@plt>
lea    -0x210(%rbp),%rdx
lea    0xe1e(%rip),%rdi
lea    0xe0b(%rip),%rsi
call   1040 <RetournerInformationConfig@plt>
lea    -0x210(%rbp),%rdx
lea    0xe0f(%rip),%rdi
lea    0xe15(%rip),%rsi
call   1040 <RetournerInformationConfig@plt>
mov    -0x21c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x21c(%rbp)
jmp    11af <initGPIO+0x6f>
movl   $0xc8,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initGPIO>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x208,%rsp
lea    0xea8(%rip),%rdi
lea    0xeae(%rip),%rsi
mov    %rsp,%rdx
call   1040 <RetournerInformationConfig@plt>
cmp    $0xc8,%eax
jne    11e6 <initGPIO+0xa6>
mov    %rsp,%rdi
call   1050 <atoi@plt>
mov    %eax,%r12d
mov    $0xc8,%eax
test   %r12d,%r12d
jle    11e6 <initGPIO+0xa6>
xor    %ebx,%ebx
mov    %rsp,%rbp
lea    0xe77(%rip),%r14
lea    0xe87(%rip),%r15
lea    0xe8d(%rip),%r13
nopl   (%rax)
mov    %rbp,%rdi
lea    0xe65(%rip),%rsi
mov    %ebx,%edx
call   1060 <sprintf@plt>
mov    %rbp,%rdi
call   1030 <voCore_gpioInit@plt>
lea    0xe52(%rip),%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
call   1040 <RetournerInformationConfig@plt>
mov    %r15,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1040 <RetournerInformationConfig@plt>
add    $0x1,%ebx
cmp    %ebx,%r12d
jne    11a0 <initGPIO+0x60>
mov    $0xc8,%eax
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"NombreBouton\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [11 x i8] c"NomBouton_\00"
@.str.4 = [7 x i8] c"Bouton\00"
@.str.5 = [13 x i8] c"ImageBouton_\00"
@.str.6 = [24 x i8] c"Light-BulbLeaf-icon.png\00"
define i32 @initGPIO() {
%1 = alloca i32
%2 = alloca [512 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %4
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%7 = call i32 @RetournerInformationConfig(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 200
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = load i32, i32* %3
store i32 %11, i32* %1
br label %33
12: ; preds = %0
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%14 = call i32 @atoi(i8* %13)
store i32 %14, i32* %4
store i32 0, i32* %5
br label %15
15: ; preds = %29, %12
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %32
19: ; preds = %15
%20 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%21 = load i32, i32* %5
%22 = call i32 @sprintf(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%24 = call i32 @voCore_gpioInit(i8* %23)
%25 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%26 = call i32 @RetournerInformationConfig(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %25)
%27 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%28 = call i32 @RetournerInformationConfig(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i8* %27)
br label %29
29: ; preds = %19
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 1
store i32 %31, i32* %5
br label %15
32: ; preds = %15
store i32 200, i32* %1
br label %33
33: ; preds = %32, %10
%34 = load i32, i32* %1
ret i32 %34
}

LLVM IR (-O2):
@.str = [13 x i8] c"NombreBouton\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [11 x i8] c"NomBouton_\00"
@.str.4 = [7 x i8] c"Bouton\00"
@.str.5 = [13 x i8] c"ImageBouton_\00"
@.str.6 = [24 x i8] c"Light-BulbLeaf-icon.png\00"
define i32 @initGPIO() {
%1 = alloca [512 x i8]
%2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%3 = call i32 @RetournerInformationConfig(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = icmp eq i32 %3, 200
br i1 %4, label %5, label %16
5: ; preds = %0
%6 = call i32 @atoi(i8* %2)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %5, %8
%9 = phi i32 [ %14, %8 ], [ 0, %5 ]
%10 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = call i32 @voCore_gpioInit(i8* %2)
%12 = call i32 @RetournerInformationConfig(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %2)
%13 = call i32 @RetournerInformationConfig(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i8* %2)
%14 = add nuw nsw i32 %9, 1
%15 = icmp eq i32 %14, %6
br i1 %15, label %16, label %8
16: ; preds = %8, %5, %0
%17 = phi i32 [ %3, %0 ], [ 200, %5 ], [ 200, %8 ]
ret i32 %17
}