#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 **create_double_int(int, int *);
char ***create_triple_char(int, int *, int);
int /*<<< orphan*/ free_simu_var(int *, int **, char ***, char ***);
int /*<<< orphan*/ print_matlab_simu_variables(int *, char ***, char ***,
                                               int **, char *);
int *read_nb_var_simu(char *);
int /*<<< orphan*/ read_simu_variables(char *, int *, char ***, char ***,
                                       int **);
void generate_simu_variables_m() {
  char *fileName, *fileout_simu;
  int *nb_var_simu, **varSizeTab;
  char ***varNameTab, ***typeTab;
  fileName = "/home/hdallali/CoManRobotranSimulator/Standalone"
             "/src/project/varState/simu_variables.txt";
  fileout_simu = "/home/hdallali/CoManRobotranSimulator/Standalone"
                 "/../workR/simu_variables.m";
  nb_var_simu = read_nb_var_simu(fileName);
  varNameTab = create_triple_char(4, nb_var_simu, 100);
  typeTab = create_triple_char(4, nb_var_simu, 100);
  varSizeTab = create_double_int(4, nb_var_simu);
  read_simu_variables(fileName, nb_var_simu, varNameTab, typeTab, varSizeTab);
  print_matlab_simu_variables(nb_var_simu, varNameTab, typeTab, varSizeTab,
                              fileout_simu);
  free_simu_var(nb_var_simu, varSizeTab, varNameTab, typeTab);
}


x86 assembly (clang, -O0):
<generate_simu_variables_m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xe91(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xedf(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <read_nb_var_simu@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    $0x4,%edi
mov    $0x64,%edx
call   1080 <create_triple_char@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rsi
mov    $0x4,%edi
mov    $0x64,%edx
call   1080 <create_triple_char@plt>
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rsi
mov    $0x4,%edi
call   1060 <create_double_int@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <read_simu_variables@plt>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%r8
call   1070 <print_matlab_simu_variables@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
call   1040 <free_simu_var@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_simu_variables_m>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
lea    0xe90(%rip),%r15
mov    %r15,%rdi
call   1050 <read_nb_var_simu@plt>
mov    %rax,%rbx
mov    $0x4,%edi
mov    %rax,%rsi
mov    $0x64,%edx
call   1080 <create_triple_char@plt>
mov    %rax,%r14
mov    $0x4,%edi
mov    %rbx,%rsi
mov    $0x64,%edx
call   1080 <create_triple_char@plt>
mov    %rax,%r12
mov    $0x4,%edi
mov    %rbx,%rsi
call   1060 <create_double_int@plt>
mov    %rax,%r13
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r12,%rcx
mov    %rax,%r8
call   1030 <read_simu_variables@plt>
lea    0xe89(%rip),%r8
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
call   1070 <print_matlab_simu_variables@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
mov    %r12,%rcx
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1040 <free_simu_var@plt>

LLVM IR (-O0):
@.str = [89 x i8] c"/home/hdallali/CoManRobotranSimulator/Standalone/src/project/varState/simu_variables.txt\00"
@.str.1 = [75 x i8] c"/home/hdallali/CoManRobotranSimulator/Standalone/../workR/simu_variables.m\00"
define void @generate_simu_variables_m() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32**
%5 = alloca i8***
%6 = alloca i8***
store i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.1, i64 0, i64 0), i8** %2
%7 = load i8*, i8** %1
%8 = call i32* @read_nb_var_simu(i8* %7)
store i32* %8, i32** %3
%9 = load i32*, i32** %3
%10 = call i8*** @create_triple_char(i32 4, i32* %9, i32 100)
store i8*** %10, i8**** %5
%11 = load i32*, i32** %3
%12 = call i8*** @create_triple_char(i32 4, i32* %11, i32 100)
store i8*** %12, i8**** %6
%13 = load i32*, i32** %3
%14 = call i32** @create_double_int(i32 4, i32* %13)
store i32** %14, i32*** %4
%15 = load i8*, i8** %1
%16 = load i32*, i32** %3
%17 = load i8***, i8**** %5
%18 = load i8***, i8**** %6
%19 = load i32**, i32*** %4
%20 = call i32 @read_simu_variables(i8* %15, i32* %16, i8*** %17, i8*** %18, i32** %19)
%21 = load i32*, i32** %3
%22 = load i8***, i8**** %5
%23 = load i8***, i8**** %6
%24 = load i32**, i32*** %4
%25 = load i8*, i8** %2
%26 = call i32 @print_matlab_simu_variables(i32* %21, i8*** %22, i8*** %23, i32** %24, i8* %25)
%27 = load i32*, i32** %3
%28 = load i32**, i32*** %4
%29 = load i8***, i8**** %5
%30 = load i8***, i8**** %6
%31 = call i32 @free_simu_var(i32* %27, i32** %28, i8*** %29, i8*** %30)
ret void
}

LLVM IR (-O2):
@.str = [89 x i8] c"/home/hdallali/CoManRobotranSimulator/Standalone/src/project/varState/simu_variables.txt\00"
@.str.1 = [75 x i8] c"/home/hdallali/CoManRobotranSimulator/Standalone/../workR/simu_variables.m\00"
define void @generate_simu_variables_m() {
%1 = tail call i32* @read_nb_var_simu(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8*** @create_triple_char(i32 4, i32* %1, i32 100)
%3 = tail call i8*** @create_triple_char(i32 4, i32* %1, i32 100)
%4 = tail call i32** @create_double_int(i32 4, i32* %1)
%5 = tail call i32 @read_simu_variables(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i32* %1, i8*** %2, i8*** %3, i32** %4)
%6 = tail call i32 @print_matlab_simu_variables(i32* %1, i8*** %2, i8*** %3, i32** %4, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @free_simu_var(i32* %1, i32** %4, i8*** %2, i8*** %3)
ret void
}