#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 /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int namespace_cleanup(char const *);
int /*<<< orphan*/ stderr;
char *strerror(int);
int delete (int argc, char **argv) {
  const char *name;
  int ret;
  if (argc < 1) {
    fprintf(stderr, "No pidns name specified\n");
    return EXIT_FAILURE;
  }
  name = argv[0];
  ret = namespace_cleanup(name);
  if (ret < 0) {
    fprintf(stderr, "Cannot remove namespace \"%s\": %s\n", name,
            strerror(ret));
    return EXIT_FAILURE;
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1171 <delete+0x41>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11e3 <delete+0xb3>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <namespace_cleanup@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    11d7 <delete+0xa7>
mov    0x2e47(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
call   1050 <strerror@plt>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rdx
mov    %rax,%rcx
lea    0xe5a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e0b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11e3 <delete+0xb3>
mov    0x2df2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    114f <delete+0x1f>
mov    (%rsi),%rbx
mov    %rbx,%rdi
call   1040 <namespace_cleanup@plt>
test   %eax,%eax
js     1168 <delete+0x38>
mov    0x2e83(%rip),%rax
jmp    1195 <delete+0x65>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
lea    0xea1(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
jmp    118e <delete+0x5e>
mov    0x2e71(%rip),%rcx
mov    (%rcx),%ebp
mov    %eax,%edi
call   1050 <strerror@plt>
lea    0xe9a(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2e43(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"No pidns name specified\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [34 x i8] c"Cannot remove namespace \22%s\22: %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @delete(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 1
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @EXIT_FAILURE
store i32 %13, i32* %3
br label %31
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
store i8* %17, i8** %6
%18 = load i8*, i8** %6
%19 = call i32 @namespace_cleanup(i8* %18)
store i32 %19, i32* %7
%20 = load i32, i32* %7
%21 = icmp slt i32 %20, 0
br i1 %21, label %22, label %29
22: ; preds = %14
%23 = load i32, i32* @stderr
%24 = load i8*, i8** %6
%25 = load i32, i32* %7
%26 = call i8* @strerror(i32 %25)
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %24, i8* %26)
%28 = load i32, i32* @EXIT_FAILURE
store i32 %28, i32* %3
br label %31
29: ; preds = %14
%30 = load i32, i32* @EXIT_SUCCESS
store i32 %30, i32* %3
br label %31
31: ; preds = %29, %22, %10
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"No pidns name specified\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [34 x i8] c"Cannot remove namespace \22%s\22: %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @delete(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 1
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 ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %15
7: ; preds = %2
%8 = load i8*, i8** %1
%9 = tail call i32 @namespace_cleanup(i8* %8)
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i32, i32* @stderr
%13 = tail call i8* @strerror(i32 %9)
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %8, i8* %13)
br label %15
15: ; preds = %7, %11, %4
%16 = phi i32* [ @EXIT_FAILURE, %4 ], [ @EXIT_FAILURE, %11 ], [ @EXIT_SUCCESS, %7 ]
%17 = load i32, i32* %16
ret i32 %17
}