#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 */
typedef scalar_t__ uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ fs_univ_unlink(scalar_t__, int /*<<< orphan*/, int, scalar_t__,
                          scalar_t__, scalar_t__ const *, int /*<<< orphan*/,
                          int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/, scalar_t__ *);
uint8_t fs_mr_unlink(uint32_t ts, uint32_t parent, uint32_t nleng,
                     const uint8_t *name, uint32_t inode) {
  uint32_t rinode;
  uint8_t status;
  status =
      fs_univ_unlink(ts, 0, 0x80, parent, nleng, name, 0, 0, 0, 0, &rinode);
  if (status != 0) {
    return status;
  }
  if (rinode != inode) {
    return 32;
  }
  return 0;
}


x86 assembly (clang, -O0):
<fs_mr_unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
xor    %esi,%esi
mov    $0x80,%edx
lea    -0x38(%rbp),%rax
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   1030 <fs_univ_unlink@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     118c <fs_mr_unlink+0x7c>
mov    -0x40(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11af <fs_mr_unlink+0x9f>
mov    -0x38(%rbp),%rax
cmp    -0x30(%rbp),%rax
je     11a7 <fs_mr_unlink+0x97>
movq   $0x20,-0x8(%rbp)
jmp    11af <fs_mr_unlink+0x9f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_mr_unlink>:
push   %rbx
sub    $0x10,%rsp
mov    %r8,%rbx
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
sub    $0x8,%rsp
lea    0x10(%rsp),%rax
xor    %esi,%esi
mov    $0x80,%edx
push   %rax
push   $0x0
push   $0x0
push   $0x0
push   $0x0
call   1030 <fs_univ_unlink@plt>
add    $0x30,%rsp
xor    %ecx,%ecx
cmp    %rbx,0x8(%rsp)
setne  %cl
shl    $0x5,%rcx
test   %rax,%rax
cmove  %rcx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @fs_mr_unlink(i64 %0, i64 %1, i64 %2, i64* %3, i64 %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64*
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
store i64 %0, i64* %7
store i64 %1, i64* %8
store i64 %2, i64* %9
store i64* %3, i64** %10
store i64 %4, i64* %11
%14 = load i64, i64* %7
%15 = load i64, i64* %8
%16 = load i64, i64* %9
%17 = load i64*, i64** %10
%18 = call i64 @fs_univ_unlink(i64 %14, i32 0, i32 128, i64 %15, i64 %16, i64* %17, i32 0, i32 0, i32 0, i32 0, i64* %12)
store i64 %18, i64* %13
%19 = load i64, i64* %13
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %5
%22 = load i64, i64* %13
store i64 %22, i64* %6
br label %29
23: ; preds = %5
%24 = load i64, i64* %12
%25 = load i64, i64* %11
%26 = icmp ne i64 %24, %25
br i1 %26, label %27, label %28
27: ; preds = %23
store i64 32, i64* %6
br label %29
28: ; preds = %23
store i64 0, i64* %6
br label %29
29: ; preds = %28, %27, %21
%30 = load i64, i64* %6
ret i64 %30
}

LLVM IR (-O2):
define i64 @fs_mr_unlink(i64 %0, i64 %1, i64 %2, i64* %3, i64 %4) {
%6 = alloca i64
%7 = bitcast i64* %6 to i8*
%8 = call i64 @fs_univ_unlink(i64 %0, i32 0, i32 128, i64 %1, i64 %2, i64* %3, i32 0, i32 0, i32 0, i32 0, i64* %6)
%9 = icmp eq i64 %8, 0
%10 = load i64, i64* %6
%11 = icmp eq i64 %10, %4
%12 = select i1 %11, i64 0, i64 32
%13 = select i1 %9, i64 %12, i64 %8
ret i64 %13
}