#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 bmount(char *);
int bumount();
int /*<<< orphan*/ leerAI();
int /*<<< orphan*/ leerMB();
int /*<<< orphan*/ leerSB();
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  printf("\n\n\nInicio ejecución leer_sf \n");
  if (argc != 2) {
    printf("ERROR: leer_sf => main: Faltan argumentos!!! El número permitido "
           "de argumentos son 2. \n");
    return -1;
  } else {
    if (bmount(argv[1]) == -1) {
      printf("ERROR: leer_sf => main: No se puede abrir el sistema que se "
             "quiere leer: %s \n",
             argv[1]);
      return -1;
    }
    leerSB();
    leerMB();
    leerAI();
    if (bumount() == -1) {
      printf("ERROR: leer_sf => main =>Error al desmontar(bumount) el sistema "
             "de ficheros.\n");
      return -1;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x2,-0x8(%rbp)
je     11a8 <main+0x48>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    122b <main+0xcb>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <bmount@plt>
cmp    $0xffffffff,%eax
jne    11e0 <main+0x80>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    122b <main+0xcb>
mov    $0x0,%al
call   1080 <leerSB@plt>
mov    $0x0,%al
call   1060 <leerMB@plt>
mov    $0x0,%al
call   1070 <leerAI@plt>
mov    $0x0,%al
call   1040 <bumount@plt>
cmp    $0xffffffff,%eax
jne    121f <main+0xbf>
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    122b <main+0xcb>
jmp    1224 <main+0xc4>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x2,%ebp
jne    11c8 <main+0x58>
mov    0x8(%rbx),%rdi
call   1060 <bmount@plt>
cmp    $0xffffffff,%eax
je     11d6 <main+0x66>
xor    %eax,%eax
call   1090 <leerSB@plt>
xor    %eax,%eax
call   1070 <leerMB@plt>
xor    %eax,%eax
call   1080 <leerAI@plt>
xor    %eax,%eax
call   1050 <bumount@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0xffffffff,%ecx
jne    11ed <main+0x7d>
lea    0xea6(%rip),%rdi
jmp    11cf <main+0x5f>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
jmp    11e8 <main+0x78>
mov    0x8(%rbx),%rsi
lea    0xe1f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"\0A\0A\0AInicio ejecuci\C3\B3n leer_sf \0A\00"
@.str.1 = [89 x i8] c"ERROR: leer_sf => main: Faltan argumentos!!! El n\C3\BAmero permitido de argumentos son 2. \0A\00"
@.str.2 = [78 x i8] c"ERROR: leer_sf => main: No se puede abrir el sistema que se quiere leer: %s \0A\00"
@.str.3 = [78 x i8] c"ERROR: leer_sf => main =>Error al desmontar(bumount) el sistema de ficheros.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %32
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @bmount(i8* %14)
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %22
17: ; preds = %11
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.2, i64 0, i64 0), i8* %20)
store i32 -1, i32* %3
br label %32
22: ; preds = %11
%23 = call i32 (...) @leerSB()
%24 = call i32 (...) @leerMB()
%25 = call i32 (...) @leerAI()
%26 = call i32 (...) @bumount()
%27 = icmp eq i32 %26, -1
br i1 %27, label %28, label %30
28: ; preds = %22
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.3, i64 0, i64 0))
store i32 -1, i32* %3
br label %32
30: ; preds = %22
br label %31
31: ; preds = %30
store i32 1, i32* %3
br label %32
32: ; preds = %31, %28, %17, %9
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
@.str.2 = [78 x i8] c"ERROR: leer_sf => main: No se puede abrir el sistema que se quiere leer: %s \0A\00"
@str = [30 x i8] c"\0A\0A\0AInicio ejecuci\C3\B3n leer_sf \00"
@str.4 = [77 x i8] c"ERROR: leer_sf => main =>Error al desmontar(bumount) el sistema de ficheros.\00"
@str.5 = [88 x i8] c"ERROR: leer_sf => main: Faltan argumentos!!! El n\C3\BAmero permitido de argumentos son 2. \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%4 = icmp eq i32 %0, 2
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @str.5, i64 0, i64 0))
br label %23
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @bmount(i8* %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = load i8*, i8** %8
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @.str.2, i64 0, i64 0), i8* %13)
br label %23
15: ; preds = %7
%16 = tail call i32 (...) @leerSB()
%17 = tail call i32 (...) @leerMB()
%18 = tail call i32 (...) @leerAI()
%19 = tail call i32 (...) @bumount()
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %23
21: ; preds = %15
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.4, i64 0, i64 0))
br label %23
23: ; preds = %15, %21, %12, %5
%24 = phi i32 [ -1, %5 ], [ -1, %12 ], [ -1, %21 ], [ 1, %15 ]
ret i32 %24
}