#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_symlink(scalar_t__, int /*<<< orphan*/, int, scalar_t__,
                           scalar_t__, scalar_t__ const *, int /*<<< orphan*/,
                           scalar_t__ const *, scalar_t__, int, scalar_t__ *,
                           int /*<<< orphan*/, int /*<<< orphan*/, scalar_t__ *,
                           int /*<<< orphan*/ *);
int /*<<< orphan*/ strlen(char *);
uint8_t fs_mr_symlink(uint32_t ts, uint32_t parent, uint32_t nleng,
                      const uint8_t *name, const uint8_t *path, uint32_t uid,
                      uint32_t gid, uint32_t inode) {
  uint32_t rinode;
  uint8_t status;
  status =
      fs_univ_symlink(ts, 0, 0x80, parent, nleng, name, strlen((char *)path),
                      path, uid, 1, &gid, 0, 0, &rinode, NULL);
  if (status != 0) {
    return status;
  }
  if (rinode != inode) {
    return 32;
  }
  return 0;
}


x86 assembly (clang, -O0):
<fs_mr_symlink>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0xb8,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
mov    %rdx,-0x38(%rbp)
mov    %rcx,-0x40(%rbp)
mov    %r8,-0x48(%rbp)
mov    %r9,-0x50(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x48(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x80(%rbp),%rdi
mov    -0x78(%rbp),%rcx
mov    -0x70(%rbp),%r8
mov    -0x68(%rbp),%r9
mov    %eax,%r14d
mov    -0x48(%rbp),%rbx
mov    -0x50(%rbp),%r11
xor    %esi,%esi
mov    $0x80,%edx
lea    0x10(%rbp),%r10
lea    -0x58(%rbp),%rax
xor    %r15d,%r15d
mov    %r14d,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11,0x10(%rsp)
movl   $0x1,0x18(%rsp)
mov    %r10,0x20(%rsp)
movl   $0x0,0x28(%rsp)
movl   $0x0,0x30(%rsp)
mov    %rax,0x38(%rsp)
movq   $0x0,0x40(%rsp)
call   1040 <fs_univ_symlink@plt>
mov    %rax,-0x60(%rbp)
cmpq   $0x0,-0x60(%rbp)
je     1200 <fs_mr_symlink+0xe0>
mov    -0x60(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1223 <fs_mr_symlink+0x103>
mov    -0x58(%rbp),%rax
cmp    0x18(%rbp),%rax
je     121b <fs_mr_symlink+0xfb>
movq   $0x20,-0x20(%rbp)
jmp    1223 <fs_mr_symlink+0x103>
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0xb8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_mr_symlink>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8,%rbx
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%rbp
mov    %r8,%rdi
call   1030 <strlen@plt>
sub    $0x8,%rsp
lea    0x8(%rsp),%r10
lea    0x48(%rsp),%r11
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x80,%edx
mov    %r13,%rcx
mov    %r12,%r8
mov    %r15,%r9
push   $0x0
push   %r10
push   $0x0
push   $0x0
push   %r11
push   $0x1
push   %r14
push   %rbx
push   %rax
call   1040 <fs_univ_symlink@plt>
add    $0x50,%rsp
mov    (%rsp),%rcx
xor    %edx,%edx
cmp    0x48(%rsp),%rcx
setne  %dl
shl    $0x5,%rdx
test   %rax,%rax
cmove  %rdx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i64 @fs_mr_symlink(i64 %0, i64 %1, i64 %2, i64* %3, i64* %4, i64 %5, i64 %6, i64 %7) {
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64*
%14 = alloca i64*
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
%19 = alloca i64
store i64 %0, i64* %10
store i64 %1, i64* %11
store i64 %2, i64* %12
store i64* %3, i64** %13
store i64* %4, i64** %14
store i64 %5, i64* %15
store i64 %6, i64* %16
store i64 %7, i64* %17
%20 = load i64, i64* %10
%21 = load i64, i64* %11
%22 = load i64, i64* %12
%23 = load i64*, i64** %13
%24 = load i64*, i64** %14
%25 = bitcast i64* %24 to i8*
%26 = call i32 @strlen(i8* %25)
%27 = load i64*, i64** %14
%28 = load i64, i64* %15
%29 = call i64 @fs_univ_symlink(i64 %20, i32 0, i32 128, i64 %21, i64 %22, i64* %23, i32 %26, i64* %27, i64 %28, i32 1, i64* %16, i32 0, i32 0, i64* %18, i32* null)
store i64 %29, i64* %19
%30 = load i64, i64* %19
%31 = icmp ne i64 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %8
%33 = load i64, i64* %19
store i64 %33, i64* %9
br label %40
34: ; preds = %8
%35 = load i64, i64* %18
%36 = load i64, i64* %17
%37 = icmp ne i64 %35, %36
br i1 %37, label %38, label %39
38: ; preds = %34
store i64 32, i64* %9
br label %40
39: ; preds = %34
store i64 0, i64* %9
br label %40
40: ; preds = %39, %38, %32
%41 = load i64, i64* %9
ret i64 %41
}

LLVM IR (-O2):
define i64 @fs_mr_symlink(i64 %0, i64 %1, i64 %2, i64* %3, i64* %4, i64 %5, i64 %6, i64 %7) {
%9 = alloca i64
%10 = alloca i64
store i64 %6, i64* %9
%11 = bitcast i64* %10 to i8*
%12 = bitcast i64* %4 to i8*
%13 = tail call i32 @strlen(i8* %12)
%14 = call i64 @fs_univ_symlink(i64 %0, i32 0, i32 128, i64 %1, i64 %2, i64* %3, i32 %13, i64* %4, i64 %5, i32 1, i64* %9, i32 0, i32 0, i64* %10, i32* null)
%15 = icmp eq i64 %14, 0
%16 = load i64, i64* %10
%17 = icmp eq i64 %16, %7
%18 = select i1 %17, i64 0, i64 32
%19 = select i1 %15, i64 %18, i64 %14
ret i64 %19
}