#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*/ bmount(char const *);
int /*<<< orphan*/ bumount();
int mi_link(char const *, char const *);
int /*<<< orphan*/ puts(char *);
int main(int argc, char const *argv[]) {
  if (argc != 4) {
    puts("Uso: mi_link <nombre_dispositivo> <pathname src> <pathname dst>");
    return -1;
  }
  const char *camino1 = argv[2], *camino2 = argv[3];
  int resultado;
  bmount(argv[1]);
  resultado = mi_link(camino1, camino2);
  bumount();
  return resultado;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     1178 <main+0x38>
lea    0xe99(%rip),%rdi
call   1030 <puts@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11ba <main+0x7a>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <bmount@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <mi_link@plt>
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   1040 <bumount@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
cmp    $0x4,%edi
jne    1172 <main+0x32>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rbx
mov    0x18(%rsi),%r14
call   1050 <bmount@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <mi_link@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <bumount@plt>
mov    %ebx,%eax
jmp    1183 <main+0x43>
lea    0xe87(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [64 x i8] c"Uso: mi_link <nombre_dispositivo> <pathname src> <pathname dst>\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 4
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @puts(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %29
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
store i8* %16, i8** %6
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 3
%19 = load i8*, i8** %18
store i8* %19, i8** %7
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @bmount(i8* %22)
%24 = load i8*, i8** %6
%25 = load i8*, i8** %7
%26 = call i32 @mi_link(i8* %24, i8* %25)
store i32 %26, i32* %8
%27 = call i32 (...) @bumount()
%28 = load i32, i32* %8
store i32 %28, i32* %3
br label %29
29: ; preds = %13, %11
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
@.str = [64 x i8] c"Uso: mi_link <nombre_dispositivo> <pathname src> <pathname dst>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
br label %16
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %1, i64 3
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @bmount(i8* %12)
%14 = tail call i32 @mi_link(i8* %8, i8* %10)
%15 = tail call i32 (...) @bumount()
br label %16
16: ; preds = %6, %4
%17 = phi i32 [ -1, %4 ], [ %14, %6 ]
ret i32 %17
}