#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*/ MNT_DETACH;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
scalar_t__ umount2(char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    fprintf(stderr, "umount PATH\n");
    return 1;
  }
  if (umount2(argv[1], MNT_DETACH)) {
    fprintf(stderr, "umount %s: %m\n", argv[1]);
    return 1;
  }
  return 0;
}


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   $0x2,-0x8(%rbp)
jge    1163 <main+0x43>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11b5 <main+0x95>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2e66(%rip),%rax
mov    (%rax),%esi
call   1030 <umount2@plt>
cmp    $0x0,%rax
je     11ae <main+0x8e>
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe72(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11b5 <main+0x95>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
jg     113f <main+0x1f>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    1174 <main+0x54>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
call   1030 <umount2@plt>
test   %rax,%rax
je     117b <main+0x5b>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
lea    0xea0(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"umount PATH\0A\00"
@MNT_DETACH = global i32 0
@.str.1 = [15 x i8] c"umount %s: %m\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 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %25
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = load i32, i32* @MNT_DETACH
%16 = call i64 @umount2(i8* %14, i32 %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %11
%19 = load i32, i32* @stderr
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %22)
store i32 1, i32* %3
br label %25
24: ; preds = %11
store i32 0, i32* %3
br label %25
25: ; preds = %24, %18, %8
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"umount PATH\0A\00"
@MNT_DETACH = global i32 0
@.str.1 = [15 x i8] c"umount %s: %m\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %17
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = load i32, i32* @MNT_DETACH
%11 = tail call i64 @umount2(i8* %9, i32 %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %7
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %8
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %7, %13, %4
%18 = phi i32 [ 1, %4 ], [ 1, %13 ], [ 0, %7 ]
ret i32 %18
}