#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int bmount(char *);
int bumount();
int /*<<< orphan*/ mi_link(char *, char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (argc != 4) {
    printf("ERROR: mi_ln => main: Faltan argumentos!!! El número permitido de "
           "argumentos son 3. \n");
    return (EXIT_FAILURE);
  } else {
    if (bmount(argv[1]) == -1) {
      printf("ERROR: mi_ln => main: Error al abrir (bmount) el sistema de "
             "ficheros.\n");
      return (EXIT_FAILURE);
    }
    mi_link(argv[2], argv[3]);
    if (bumount() == -1) {
      printf("ERROR: mi_ln => main =>Error al desmontar(bumount) el sistema de "
             "ficheros.\n");
      return (EXIT_FAILURE);
    }
  }
  return (EXIT_SUCCESS);
}


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)
cmpl   $0x4,-0x8(%rbp)
je     117d <main+0x3d>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1203 <main+0xc3>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <bmount@plt>
cmp    $0xffffffff,%eax
jne    11b0 <main+0x70>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e3a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1203 <main+0xc3>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
call   1060 <mi_link@plt>
mov    $0x0,%al
call   1040 <bumount@plt>
cmp    $0xffffffff,%eax
jne    11f2 <main+0xb2>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2df8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1203 <main+0xc3>
jmp    11f7 <main+0xb7>
mov    0x2dda(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x4,%edi
jne    1179 <main+0x39>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1050 <bmount@plt>
cmp    $0xffffffff,%eax
je     1182 <main+0x42>
mov    0x10(%rbx),%rdi
mov    0x18(%rbx),%rsi
call   1060 <mi_link@plt>
xor    %eax,%eax
call   1040 <bumount@plt>
cmp    $0xffffffff,%eax
je     118b <main+0x4b>
mov    0x2e61(%rip),%rax
jmp    119e <main+0x5e>
lea    0xf11(%rip),%rdi
jmp    1192 <main+0x52>
lea    0xec2(%rip),%rdi
jmp    1192 <main+0x52>
lea    0xe6e(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e42(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [87 x i8] c"ERROR: mi_ln => main: Faltan argumentos!!! El n\C3\BAmero permitido de argumentos son 3. \0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [71 x i8] c"ERROR: mi_ln => main: Error al abrir (bmount) el sistema de ficheros.\0A\00"
@.str.2 = [76 x i8] c"ERROR: mi_ln => main =>Error al desmontar(bumount) el sistema de ficheros.\0A\00"
@EXIT_SUCCESS = global i32 0
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 = load i32, i32* %4
%7 = icmp ne i32 %6, 4
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
store i32 %10, i32* %3
br label %36
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 %20
17: ; preds = %11
%18 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.1, i64 0, i64 0))
%19 = load i32, i32* @EXIT_FAILURE
store i32 %19, i32* %3
br label %36
20: ; preds = %11
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 2
%23 = load i8*, i8** %22
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 3
%26 = load i8*, i8** %25
%27 = call i32 @mi_link(i8* %23, i8* %26)
%28 = call i32 (...) @bumount()
%29 = icmp eq i32 %28, -1
br i1 %29, label %30, label %33
30: ; preds = %20
%31 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.2, i64 0, i64 0))
%32 = load i32, i32* @EXIT_FAILURE
store i32 %32, i32* %3
br label %36
33: ; preds = %20
br label %34
34: ; preds = %33
%35 = load i32, i32* @EXIT_SUCCESS
store i32 %35, i32* %3
br label %36
36: ; preds = %34, %30, %17, %8
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
@str = [75 x i8] c"ERROR: mi_ln => main =>Error al desmontar(bumount) el sistema de ficheros.\00"
@str.3 = [70 x i8] c"ERROR: mi_ln => main: Error al abrir (bmount) el sistema de ficheros.\00"
@str.4 = [86 x i8] c"ERROR: mi_ln => main: Faltan argumentos!!! El n\C3\BAmero permitido de argumentos son 3. \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @bmount(i8* %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %17, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8*, i8** %1, i64 3
%13 = load i8*, i8** %12
%14 = tail call i32 @mi_link(i8* %11, i8* %13)
%15 = tail call i32 (...) @bumount()
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %20
17: ; preds = %9, %4, %2
%18 = phi i8* [ getelementptr inbounds ([86 x i8], [86 x i8]* @str.4, i64 0, i64 0), %2 ], [ getelementptr inbounds ([70 x i8], [70 x i8]* @str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([75 x i8], [75 x i8]* @str, i64 0, i64 0), %9 ]
%19 = tail call i32 @puts(i8* dereferenceable(1) %18)
br label %20
20: ; preds = %17, %9
%21 = phi i32* [ @EXIT_SUCCESS, %9 ], [ @EXIT_FAILURE, %17 ]
%22 = load i32, i32* %21
ret i32 %22
}