#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 */
char **create_double_char(int, int);
int **create_double_int(int, int *);
char ***create_triple_char(int, int *, int);
int ***create_triple_int(int, int *, int);
int /*<<< orphan*/ free_ctrl_var(int, int *, char ***, char ***, char **,
                                 int **, int ***);
int /*<<< orphan*/ print_matlab_control_variables(int, int *, char ***,
                                                  char ***, int **, int ***,
                                                  char **, char *);
int /*<<< orphan*/ read_ctrl_variables(char *, int, int *, char ***, char ***,
                                       int **, int ***, char **);
int read_nb_ctrl(char *);
int *read_nb_var_ctrl(char *, int);
void generate_control_variables_m() {
  char *fileName, *fileout_ctrl;
  int nb_ctrl;
  int *nb_var_ctrl, **varSizeTab, ***twoVarSizeTab;
  char ***varNameTab, ***typeTab, ***strTypeTab, **namesCtrl;
  fileName = "/home/hdallali/CoManRobotranSimulator/Standalone"
             "/src/project/varState/control_variables.txt";
  fileout_ctrl = "/home/hdallali/CoManRobotranSimulator/Standalone"
                 "/../workR/control_variables.m";
  nb_ctrl = read_nb_ctrl(fileName);
  nb_var_ctrl = read_nb_var_ctrl(fileName, nb_ctrl);
  varNameTab = create_triple_char(nb_ctrl, nb_var_ctrl, 100);
  typeTab = create_triple_char(nb_ctrl, nb_var_ctrl, 100);
  strTypeTab = create_triple_char(nb_ctrl, nb_var_ctrl, 100);
  varSizeTab = create_double_int(nb_ctrl, nb_var_ctrl);
  namesCtrl = create_double_char(nb_ctrl, 100);
  twoVarSizeTab = create_triple_int(nb_ctrl, nb_var_ctrl, 2);
  read_ctrl_variables(fileName, nb_ctrl, nb_var_ctrl, varNameTab, typeTab,
                      varSizeTab, twoVarSizeTab, namesCtrl);
  print_matlab_control_variables(nb_ctrl, nb_var_ctrl, varNameTab, typeTab,
                                 varSizeTab, twoVarSizeTab, namesCtrl,
                                 fileout_ctrl);
  free_ctrl_var(nb_ctrl, nb_var_ctrl, varNameTab, typeTab, namesCtrl,
                varSizeTab, twoVarSizeTab);
}


x86 assembly (clang, -O0):
<generate_control_variables_m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    0xe61(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeb2(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1080 <read_nb_ctrl@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <read_nb_var_ctrl@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    $0x64,%edx
call   10b0 <create_triple_char@plt>
mov    %rax,-0x38(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    $0x64,%edx
call   10b0 <create_triple_char@plt>
mov    %rax,-0x40(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    $0x64,%edx
call   10b0 <create_triple_char@plt>
mov    %rax,-0x48(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1060 <create_double_int@plt>
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x64,%esi
call   1030 <create_double_char@plt>
mov    %rax,-0x50(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    $0x2,%edx
call   1040 <create_triple_int@plt>
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x40(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%r10
mov    -0x50(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1070 <read_ctrl_variables@plt>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    -0x50(%rbp),%r10
mov    -0x10(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   10a0 <print_matlab_control_variables@plt>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%rcx
mov    -0x50(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    %rax,(%rsp)
call   1090 <free_ctrl_var@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_control_variables_m>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xe5b(%rip),%rbp
mov    %rbp,%rdi
call   1080 <read_nb_ctrl@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
mov    %eax,%esi
call   1050 <read_nb_var_ctrl@plt>
mov    %rax,%r14
mov    %ebx,%edi
mov    %rax,%rsi
mov    $0x64,%edx
call   10b0 <create_triple_char@plt>
mov    %rax,%r12
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x64,%edx
call   10b0 <create_triple_char@plt>
mov    %rax,0x10(%rsp)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x64,%edx
call   10b0 <create_triple_char@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1060 <create_double_int@plt>
mov    %rax,%r13
mov    %ebx,%edi
mov    $0x64,%esi
call   1030 <create_double_char@plt>
mov    %rax,%r15
mov    %rax,0x8(%rsp)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x2,%edx
call   1040 <create_triple_int@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
mov    %r14,%rdx
mov    %r12,%rcx
mov    0x10(%rsp),%rbp
mov    %rbp,%r8
mov    %r13,(%rsp)
mov    %r13,%r9
push   %r15
push   %rax
mov    %rax,%r15
call   1070 <read_ctrl_variables@plt>
add    $0x10,%rsp
lea    0xe0b(%rip),%rax
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r12,%rdx
mov    %rbp,%rcx
mov    %r13,%r8
mov    %r15,%r9
push   %rax
mov    0x10(%rsp),%r13
push   %r13
call   10a0 <print_matlab_control_variables@plt>
add    $0x8,%rsp
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r12,%rdx
mov    %rbp,%rcx
mov    %r13,%r8
mov    0x8(%rsp),%r9
push   %r15
call   1090 <free_ctrl_var@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [92 x i8] c"/home/hdallali/CoManRobotranSimulator/Standalone/src/project/varState/control_variables.txt\00"
@.str.1 = [78 x i8] c"/home/hdallali/CoManRobotranSimulator/Standalone/../workR/control_variables.m\00"
define void @generate_control_variables_m() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32**
%6 = alloca i32***
%7 = alloca i8***
%8 = alloca i8***
%9 = alloca i8***
%10 = alloca i8**
store i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0), i8** %2
%11 = load i8*, i8** %1
%12 = call i32 @read_nb_ctrl(i8* %11)
store i32 %12, i32* %3
%13 = load i8*, i8** %1
%14 = load i32, i32* %3
%15 = call i32* @read_nb_var_ctrl(i8* %13, i32 %14)
store i32* %15, i32** %4
%16 = load i32, i32* %3
%17 = load i32*, i32** %4
%18 = call i8*** @create_triple_char(i32 %16, i32* %17, i32 100)
store i8*** %18, i8**** %7
%19 = load i32, i32* %3
%20 = load i32*, i32** %4
%21 = call i8*** @create_triple_char(i32 %19, i32* %20, i32 100)
store i8*** %21, i8**** %8
%22 = load i32, i32* %3
%23 = load i32*, i32** %4
%24 = call i8*** @create_triple_char(i32 %22, i32* %23, i32 100)
store i8*** %24, i8**** %9
%25 = load i32, i32* %3
%26 = load i32*, i32** %4
%27 = call i32** @create_double_int(i32 %25, i32* %26)
store i32** %27, i32*** %5
%28 = load i32, i32* %3
%29 = call i8** @create_double_char(i32 %28, i32 100)
store i8** %29, i8*** %10
%30 = load i32, i32* %3
%31 = load i32*, i32** %4
%32 = call i32*** @create_triple_int(i32 %30, i32* %31, i32 2)
store i32*** %32, i32**** %6
%33 = load i8*, i8** %1
%34 = load i32, i32* %3
%35 = load i32*, i32** %4
%36 = load i8***, i8**** %7
%37 = load i8***, i8**** %8
%38 = load i32**, i32*** %5
%39 = load i32***, i32**** %6
%40 = load i8**, i8*** %10
%41 = call i32 @read_ctrl_variables(i8* %33, i32 %34, i32* %35, i8*** %36, i8*** %37, i32** %38, i32*** %39, i8** %40)
%42 = load i32, i32* %3
%43 = load i32*, i32** %4
%44 = load i8***, i8**** %7
%45 = load i8***, i8**** %8
%46 = load i32**, i32*** %5
%47 = load i32***, i32**** %6
%48 = load i8**, i8*** %10
%49 = load i8*, i8** %2
%50 = call i32 @print_matlab_control_variables(i32 %42, i32* %43, i8*** %44, i8*** %45, i32** %46, i32*** %47, i8** %48, i8* %49)
%51 = load i32, i32* %3
%52 = load i32*, i32** %4
%53 = load i8***, i8**** %7
%54 = load i8***, i8**** %8
%55 = load i8**, i8*** %10
%56 = load i32**, i32*** %5
%57 = load i32***, i32**** %6
%58 = call i32 @free_ctrl_var(i32 %51, i32* %52, i8*** %53, i8*** %54, i8** %55, i32** %56, i32*** %57)
ret void
}

LLVM IR (-O2):
@.str = [92 x i8] c"/home/hdallali/CoManRobotranSimulator/Standalone/src/project/varState/control_variables.txt\00"
@.str.1 = [78 x i8] c"/home/hdallali/CoManRobotranSimulator/Standalone/../workR/control_variables.m\00"
define void @generate_control_variables_m() {
%1 = tail call i32 @read_nb_ctrl(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32* @read_nb_var_ctrl(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i8*** @create_triple_char(i32 %1, i32* %2, i32 100)
%4 = tail call i8*** @create_triple_char(i32 %1, i32* %2, i32 100)
%5 = tail call i8*** @create_triple_char(i32 %1, i32* %2, i32 100)
%6 = tail call i32** @create_double_int(i32 %1, i32* %2)
%7 = tail call i8** @create_double_char(i32 %1, i32 100)
%8 = tail call i32*** @create_triple_int(i32 %1, i32* %2, i32 2)
%9 = tail call i32 @read_ctrl_variables(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str, i64 0, i64 0), i32 %1, i32* %2, i8*** %3, i8*** %4, i32** %6, i32*** %8, i8** %7)
%10 = tail call i32 @print_matlab_control_variables(i32 %1, i32* %2, i8*** %3, i8*** %4, i32** %6, i32*** %8, i8** %7, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i32 @free_ctrl_var(i32 %1, i32* %2, i8*** %3, i8*** %4, i8** %7, i32** %6, i32*** %8)
ret void
}