#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*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
scalar_t__ umount(char const *);
scalar_t__ unlink(char const *);
int del(const char *path) {
  if (umount(path) != 0) {
    fprintf(stderr, "can't umount namespace '%s': %s\n", path, strerror(errno));
    return -1;
  }
  if (unlink(path) != 0) {
    fprintf(stderr, "can't unlink %s: %s\n", path, strerror(errno));
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<del>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <umount@plt>
cmp    $0x0,%rax
je     11a3 <del+0x63>
mov    0x2e7a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
lea    0xe6e(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1201 <del+0xc1>
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%rax
je     11fa <del+0xba>
mov    0x2e23(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    0x2e07(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rdx
mov    %rax,%rcx
lea    0xe38(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1201 <del+0xc1>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<del>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1040 <umount@plt>
test   %rax,%rax
je     115a <del+0x1a>
lea    0xea8(%rip),%r14
jmp    116e <del+0x2e>
mov    %rbx,%rdi
call   1030 <unlink@plt>
test   %rax,%rax
je     119f <del+0x5f>
lea    0xeb3(%rip),%r14
mov    0x2e6b(%rip),%rax
mov    (%rax),%ebp
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1050 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
xor    %eax,%eax
jmp    119a <del+0x5a>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"can't umount namespace '%s': %s\0A\00"
@errno = global i32 0
@.str.1 = [21 x i8] c"can't unlink %s: %s\0A\00"
define i32 @del(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @umount(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %3
%10 = load i32, i32* @errno
%11 = call i8* @strerror(i32 %10)
%12 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %11)
store i32 -1, i32* %2
br label %24
13: ; preds = %1
%14 = load i8*, i8** %3
%15 = call i64 @unlink(i8* %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %13
%18 = load i32, i32* @stderr
%19 = load i8*, i8** %3
%20 = load i32, i32* @errno
%21 = call i8* @strerror(i32 %20)
%22 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %19, i8* %21)
store i32 -1, i32* %2
br label %24
23: ; preds = %13
store i32 0, i32* %2
br label %24
24: ; preds = %23, %17, %7
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"can't umount namespace '%s': %s\0A\00"
@errno = global i32 0
@.str.1 = [21 x i8] c"can't unlink %s: %s\0A\00"
define i32 @del(i8* %0) {
%2 = tail call i64 @umount(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i64 @unlink(i8* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %4, %1
%8 = phi i8* [ getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), %4 ]
%9 = load i32, i32* @stderr
%10 = load i32, i32* @errno
%11 = tail call i8* @strerror(i32 %10)
%12 = tail call i32 @fprintf(i32 %9, i8* %8, i8* %0, i8* %11)
br label %13
13: ; preds = %7, %4
%14 = phi i32 [ 0, %4 ], [ -1, %7 ]
ret i32 %14
}