#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*/ cat_main(int, char **);
int /*<<< orphan*/ cd_main(int, char **);
int /*<<< orphan*/ ls_main(int, char **);
int /*<<< orphan*/ mkdir_main(int, char **);
int /*<<< orphan*/ nano_main(int, char **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3();
int testScript_main(int argc, char *argv[]) {
  printf("-----------------------------------------------------\n");
  printf("-----------------------------------------------------\n");
  printf("testscript: Probando las funciones del filesystem\n");
  printf("******************************************************\n");
  printf("Corriendo pruebas de integridad\n");
  test1();
  test2();
  test3();
  printf("Pruebas de integridad terminadas\n");
  printf("******************************************************\n");
  printf("***1.Listar home luego de la inicializacion\n");
  char *home[] = {"ls", "/"};
  ls_main(2, home);
  printf("***2.Crear un directorio de nombre pepe\n");
  char *pepe[2] = {"ls", "/pepe"};
  mkdir_main(2, pepe);
  printf("***3.Listar home con el directorio nuevo\n");
  ls_main(2, home);
  printf("***4.Crear un archivo con texto de prueba\n");
  char *nanoTest[3] = {"nano", "/pepe/a.txt", "lorem ipsum dolor sit amet"};
  nano_main(3, nanoTest);
  printf("***5.Cambiar al directorio pepe\n");
  cd_main(2, pepe);
  printf("***6.Listar el directorio pepe que ahora contiene el archivo de "
         "texto\n");
  ls_main(2, pepe);
  char *archive[2] = {"cat", "/pepe/a.txt"};
  printf("***7. Mostrar los contenidos del archivo de texto\n");
  cat_main(2, archive);
  printf("-----------------------------------------------------\n");
  printf("--------------------------Fin------------------------\n");
}


x86 assembly (clang, -O0):
<testScript_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe5a(%rip),%rdi
call   1070 <printf@plt>
lea    0xe4e(%rip),%rdi
call   1070 <printf@plt>
lea    0xe79(%rip),%rdi
call   1070 <printf@plt>
lea    0xea0(%rip),%rdi
call   1070 <printf@plt>
lea    0xecc(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1060 <test1@plt>
mov    $0x0,%al
call   10a0 <test2@plt>
mov    $0x0,%al
call   1050 <test3@plt>
lea    0xecc(%rip),%rdi
call   1070 <printf@plt>
lea    0xe67(%rip),%rdi
call   1070 <printf@plt>
lea    0xed6(%rip),%rdi
call   1070 <printf@plt>
mov    0x2bb5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2bb2(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rsi
mov    $0x2,%edi
call   1090 <ls_main@plt>
lea    0xed8(%rip),%rdi
call   1070 <printf@plt>
mov    0x2b95(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2b92(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x30(%rbp),%rsi
mov    $0x2,%edi
call   1040 <mkdir_main@plt>
lea    0xed7(%rip),%rdi
call   1070 <printf@plt>
lea    -0x20(%rbp),%rsi
mov    $0x2,%edi
call   1090 <ls_main@plt>
lea    0xee7(%rip),%rdi
call   1070 <printf@plt>
mov    0x2b5b(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0x2b58(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0x2b55(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    -0x50(%rbp),%rsi
mov    $0x3,%edi
call   1030 <nano_main@plt>
lea    0xf03(%rip),%rdi
call   1070 <printf@plt>
lea    -0x30(%rbp),%rsi
mov    $0x2,%edi
call   1080 <cd_main@plt>
lea    0xf0a(%rip),%rdi
call   1070 <printf@plt>
lea    -0x30(%rbp),%rsi
mov    $0x2,%edi
call   1090 <ls_main@plt>
mov    0x2b18(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0x2b15(%rip),%rax
mov    %rax,-0x58(%rbp)
lea    0xf25(%rip),%rdi
call   1070 <printf@plt>
lea    -0x60(%rbp),%rsi
mov    $0x2,%edi
call   10b0 <cat_main@plt>
lea    0xcd8(%rip),%rdi
call   1070 <printf@plt>
lea    0xf32(%rip),%rdi
call   1070 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testScript_main>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
lea    0x1084(%rip),%r14
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
lea    0xe84(%rip),%rdi
call   1040 <puts@plt>
lea    0xeeb(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0xe9b(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1070 <test1@plt>
xor    %eax,%eax
call   10a0 <test2@plt>
xor    %eax,%eax
call   1060 <test3@plt>
lea    0xe9a(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0xede(%rip),%rdi
call   1040 <puts@plt>
movaps 0x2bbd(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
lea    0x40(%rsp),%rbx
mov    $0x2,%edi
mov    %rbx,%rsi
call   1090 <ls_main@plt>
lea    0xee0(%rip),%rdi
call   1040 <puts@plt>
movaps 0x2ba3(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
lea    0x30(%rsp),%r15
mov    $0x2,%edi
mov    %r15,%rsi
call   1050 <mkdir_main@plt>
lea    0xede(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
call   1090 <ls_main@plt>
lea    0xeee(%rip),%rdi
call   1040 <puts@plt>
mov    0x2b80(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0x2b64(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rsi
mov    $0x3,%edi
call   1030 <nano_main@plt>
lea    0xee5(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2,%edi
mov    %r15,%rsi
call   1080 <cd_main@plt>
lea    0xeec(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2,%edi
mov    %r15,%rsi
call   1090 <ls_main@plt>
movaps 0x2b37(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xf0e(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rsi
mov    $0x2,%edi
call   10b0 <cat_main@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
lea    0xf55(%rip),%rdi
call   1040 <puts@plt>
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [55 x i8] c"-----------------------------------------------------\0A\00"
@.str.1 = [51 x i8] c"testscript: Probando las funciones del filesystem\0A\00"
@.str.2 = [56 x i8] c"******************************************************\0A\00"
@.str.3 = [33 x i8] c"Corriendo pruebas de integridad\0A\00"
@.str.4 = [34 x i8] c"Pruebas de integridad terminadas\0A\00"
@.str.5 = [45 x i8] c"***1.Listar home luego de la inicializacion\0A\00"
@.str.6 = [3 x i8] c"ls\00"
@.str.7 = [2 x i8] c"/\00"
@__const.testScript_main.home = [2 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i32 0, i32 0)]
@.str.8 = [41 x i8] c"***2.Crear un directorio de nombre pepe\0A\00"
@.str.9 = [6 x i8] c"/pepe\00"
@__const.testScript_main.pepe = [2 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i32 0, i32 0)]
@.str.10 = [42 x i8] c"***3.Listar home con el directorio nuevo\0A\00"
@.str.11 = [43 x i8] c"***4.Crear un archivo con texto de prueba\0A\00"
@.str.12 = [5 x i8] c"nano\00"
@.str.13 = [12 x i8] c"/pepe/a.txt\00"
@.str.14 = [27 x i8] c"lorem ipsum dolor sit amet\00"
@__const.testScript_main.nanoTest = [3 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i32 0, i32 0)]
@.str.15 = [33 x i8] c"***5.Cambiar al directorio pepe\0A\00"
@.str.16 = [71 x i8] c"***6.Listar el directorio pepe que ahora contiene el archivo de texto\0A\00"
@.str.17 = [4 x i8] c"cat\00"
@__const.testScript_main.archive = [2 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i32 0, i32 0)]
@.str.18 = [51 x i8] c"***7. Mostrar los contenidos del archivo de texto\0A\00"
@.str.19 = [55 x i8] c"--------------------------Fin------------------------\0A\00"
define i32 @testScript_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i8*]
%7 = alloca [2 x i8*]
%8 = alloca [3 x i8*]
%9 = alloca [2 x i8*]
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 (...) @test1()
%16 = call i32 (...) @test2()
%17 = call i32 (...) @test3()
%18 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0))
%21 = bitcast [2 x i8*]* %6 to i8*
%22 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 0
%23 = call i32 @ls_main(i32 2, i8** %22)
%24 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0))
%25 = bitcast [2 x i8*]* %7 to i8*
%26 = getelementptr inbounds [2 x i8*], [2 x i8*]* %7, i64 0, i64 0
%27 = call i32 @mkdir_main(i32 2, i8** %26)
%28 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.10, i64 0, i64 0))
%29 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 0
%30 = call i32 @ls_main(i32 2, i8** %29)
%31 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.11, i64 0, i64 0))
%32 = bitcast [3 x i8*]* %8 to i8*
%33 = getelementptr inbounds [3 x i8*], [3 x i8*]* %8, i64 0, i64 0
%34 = call i32 @nano_main(i32 3, i8** %33)
%35 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.15, i64 0, i64 0))
%36 = getelementptr inbounds [2 x i8*], [2 x i8*]* %7, i64 0, i64 0
%37 = call i32 @cd_main(i32 2, i8** %36)
%38 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.16, i64 0, i64 0))
%39 = getelementptr inbounds [2 x i8*], [2 x i8*]* %7, i64 0, i64 0
%40 = call i32 @ls_main(i32 2, i8** %39)
%41 = bitcast [2 x i8*]* %9 to i8*
%42 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.18, i64 0, i64 0))
%43 = getelementptr inbounds [2 x i8*], [2 x i8*]* %9, i64 0, i64 0
%44 = call i32 @cat_main(i32 2, i8** %43)
%45 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%46 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.19, i64 0, i64 0))
%47 = load i32, i32* %3
ret i32 %47
}

LLVM IR (-O2):
@.str.6 = [3 x i8] c"ls\00"
@.str.7 = [2 x i8] c"/\00"
@__const.testScript_main.home = [2 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i32 0, i32 0)]
@.str.9 = [6 x i8] c"/pepe\00"
@__const.testScript_main.pepe = [2 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i32 0, i32 0)]
@.str.12 = [5 x i8] c"nano\00"
@.str.13 = [12 x i8] c"/pepe/a.txt\00"
@.str.14 = [27 x i8] c"lorem ipsum dolor sit amet\00"
@__const.testScript_main.nanoTest = [3 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i32 0, i32 0)]
@.str.17 = [4 x i8] c"cat\00"
@__const.testScript_main.archive = [2 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i32 0, i32 0)]
@str.21 = [50 x i8] c"testscript: Probando las funciones del filesystem\00"
@str.23 = [32 x i8] c"Corriendo pruebas de integridad\00"
@str.24 = [33 x i8] c"Pruebas de integridad terminadas\00"
@str.25 = [55 x i8] c"******************************************************\00"
@str.26 = [44 x i8] c"***1.Listar home luego de la inicializacion\00"
@str.27 = [40 x i8] c"***2.Crear un directorio de nombre pepe\00"
@str.28 = [41 x i8] c"***3.Listar home con el directorio nuevo\00"
@str.29 = [42 x i8] c"***4.Crear un archivo con texto de prueba\00"
@str.30 = [32 x i8] c"***5.Cambiar al directorio pepe\00"
@str.31 = [70 x i8] c"***6.Listar el directorio pepe que ahora contiene el archivo de texto\00"
@str.32 = [50 x i8] c"***7. Mostrar los contenidos del archivo de texto\00"
@str.33 = [54 x i8] c"-----------------------------------------------------\00"
@str.34 = [54 x i8] c"--------------------------Fin------------------------\00"
define i32 @testScript_main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x i8*]
%4 = alloca [2 x i8*]
%5 = alloca [3 x i8*]
%6 = alloca [2 x i8*]
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.33, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.33, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.21, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.25, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.23, i64 0, i64 0))
%12 = tail call i32 (...) @test1()
%13 = tail call i32 (...) @test2()
%14 = tail call i32 (...) @test3()
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.24, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.25, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.26, i64 0, i64 0))
%18 = bitcast [2 x i8*]* %3 to i8*
%19 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 0
%20 = call i32 @ls_main(i32 2, i8** %19)
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.27, i64 0, i64 0))
%22 = bitcast [2 x i8*]* %4 to i8*
%23 = getelementptr inbounds [2 x i8*], [2 x i8*]* %4, i64 0, i64 0
%24 = call i32 @mkdir_main(i32 2, i8** %23)
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.28, i64 0, i64 0))
%26 = call i32 @ls_main(i32 2, i8** %19)
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.29, i64 0, i64 0))
%28 = bitcast [3 x i8*]* %5 to i8*
%29 = getelementptr inbounds [3 x i8*], [3 x i8*]* %5, i64 0, i64 0
%30 = call i32 @nano_main(i32 3, i8** %29)
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.30, i64 0, i64 0))
%32 = call i32 @cd_main(i32 2, i8** %23)
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str.31, i64 0, i64 0))
%34 = call i32 @ls_main(i32 2, i8** %23)
%35 = bitcast [2 x i8*]* %6 to i8*
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.32, i64 0, i64 0))
%37 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 0
%38 = call i32 @cat_main(i32 2, i8** %37)
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.33, i64 0, i64 0))
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.34, i64 0, i64 0))
ret i32 undef
}