#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_link(scalar_t__, int /*<<< orphan*/, int, scalar_t__,
                        scalar_t__, scalar_t__, scalar_t__ *,
                        int /*<<< orphan*/, int /*<<< orphan*/,
                        int /*<<< orphan*/ *, int /*<<< orphan*/,
                        int /*<<< orphan*/, scalar_t__ *, int /*<<< orphan*/ *);
uint8_t fs_mr_link(uint32_t ts, uint32_t inode_src, uint32_t parent_dst,
                   uint32_t nleng_dst, uint8_t *name_dst) {
  uint32_t rinode;
  uint8_t status;
  status = fs_univ_link(ts, 0, 0x80, inode_src, parent_dst, nleng_dst, name_dst,
                        0, 0, NULL, 0, 0, &rinode, NULL);
  if (status != 0) {
    return status;
  }
  if (rinode != inode_src) {
    return 32;
  }
  return 0;
}


x86 assembly (clang, -O0):
<fs_mr_link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%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
mov    -0x30(%rbp),%r10
xor    %esi,%esi
mov    $0x80,%edx
xor    %eax,%eax
lea    -0x38(%rbp),%rax
mov    %r10,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movq   $0x0,0x18(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x0,0x28(%rsp)
mov    %rax,0x30(%rsp)
movq   $0x0,0x38(%rsp)
call   1030 <fs_univ_link@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     11ac <fs_mr_link+0x9c>
mov    -0x40(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11cf <fs_mr_link+0xbf>
mov    -0x38(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     11c7 <fs_mr_link+0xb7>
movq   $0x20,-0x8(%rbp)
jmp    11cf <fs_mr_link+0xbf>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_mr_link>:
push   %rbx
sub    $0x10,%rsp
mov    %r8,%rax
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rbx
lea    0x8(%rsp),%r10
xor    %esi,%esi
mov    $0x80,%edx
mov    %rbx,%rcx
push   $0x0
push   %r10
push   $0x0
push   $0x0
push   $0x0
push   $0x0
push   $0x0
push   %rax
call   1030 <fs_univ_link@plt>
add    $0x40,%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_link(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 = load i64*, i64** %11
%19 = call i64 @fs_univ_link(i64 %14, i32 0, i32 128, i64 %15, i64 %16, i64 %17, i64* %18, i32 0, i32 0, i32* null, i32 0, i32 0, i64* %12, i32* null)
store i64 %19, i64* %13
%20 = load i64, i64* %13
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %5
%23 = load i64, i64* %13
store i64 %23, i64* %6
br label %30
24: ; preds = %5
%25 = load i64, i64* %12
%26 = load i64, i64* %8
%27 = icmp ne i64 %25, %26
br i1 %27, label %28, label %29
28: ; preds = %24
store i64 32, i64* %6
br label %30
29: ; preds = %24
store i64 0, i64* %6
br label %30
30: ; preds = %29, %28, %22
%31 = load i64, i64* %6
ret i64 %31
}

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