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

/* Variables and functions */
int fs_univ_create(scalar_t__, int /*<<< orphan*/, int, scalar_t__, scalar_t__,
                   int const *, int, int /*<<< orphan*/, int /*<<< orphan*/,
                   scalar_t__, int, scalar_t__ *, int /*<<< orphan*/,
                   int /*<<< orphan*/, scalar_t__, int /*<<< orphan*/,
                   scalar_t__ *, int /*<<< orphan*/ *);
int fsnodes_type_convert(int);
uint8_t fs_mr_create(uint32_t ts, uint32_t parent, uint32_t nleng,
                     const uint8_t *name, uint8_t type, uint16_t mode,
                     uint16_t cumask, uint32_t uid, uint32_t gid, uint32_t rdev,
                     uint32_t inode) {
  uint32_t rinode;
  uint8_t status;
  if (type > 15) {
    type = fsnodes_type_convert(type);
  }
  status = fs_univ_create(ts, 0, 0x80, parent, nleng, name, type, mode, cumask,
                          uid, 1, &gid, 0, 0, rdev, 0, &rinode, NULL);
  if (status != 0) {
    return status;
  }
  if (rinode != inode) {
    return 32;
  }
  return 0;
}


x86 assembly (clang, -O0):
<fs_mr_create>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x38(%rbp)
mov    %rsi,-0x40(%rbp)
mov    %rdx,-0x48(%rbp)
mov    %rcx,-0x50(%rbp)
mov    %r8d,-0x54(%rbp)
mov    %r9d,-0x58(%rbp)
cmpl   $0xf,-0x54(%rbp)
jle    1174 <fs_mr_create+0x54>
mov    -0x54(%rbp),%edi
call   1040 <fsnodes_type_convert@plt>
mov    %eax,-0x54(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rcx
mov    -0x48(%rbp),%r8
mov    -0x50(%rbp),%r9
mov    -0x54(%rbp),%r12d
mov    -0x58(%rbp),%r15d
mov    0x10(%rbp),%r14d
mov    0x18(%rbp),%rbx
mov    0x28(%rbp),%r10
xor    %esi,%esi
mov    $0x80,%edx
lea    0x20(%rbp),%r11
lea    -0x60(%rbp),%rax
xor    %r13d,%r13d
mov    %r12d,(%rsp)
mov    %r15d,0x8(%rsp)
mov    %r14d,0x10(%rsp)
mov    %rbx,0x18(%rsp)
movl   $0x1,0x20(%rsp)
mov    %r11,0x28(%rsp)
movl   $0x0,0x30(%rsp)
movl   $0x0,0x38(%rsp)
mov    %r10,0x40(%rsp)
movl   $0x0,0x48(%rsp)
mov    %rax,0x50(%rsp)
movq   $0x0,0x58(%rsp)
call   1030 <fs_univ_create@plt>
mov    %eax,-0x64(%rbp)
cmpl   $0x0,-0x64(%rbp)
je     1212 <fs_mr_create+0xf2>
mov    -0x64(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    1233 <fs_mr_create+0x113>
mov    -0x60(%rbp),%rax
cmp    0x30(%rbp),%rax
je     122c <fs_mr_create+0x10c>
movl   $0x20,-0x2c(%rbp)
jmp    1233 <fs_mr_create+0x113>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_mr_create>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r14d
mov    %r8d,%eax
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%rbx
mov    0x40(%rsp),%ebp
cmp    $0x10,%r8d
jl     114e <fs_mr_create+0x2e>
mov    %eax,%edi
call   1040 <fsnodes_type_convert@plt>
mov    %rsp,%r11
lea    0x50(%rsp),%r10
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x80,%edx
mov    %r13,%rcx
mov    %r12,%r8
mov    %r15,%r9
push   $0x0
push   %r11
push   $0x0
push   0x70(%rsp)
push   $0x0
push   $0x0
push   %r10
push   $0x1
push   0x88(%rsp)
push   %rbp
push   %r14
push   %rax
call   1030 <fs_univ_create@plt>
add    $0x60,%rsp
xor    %ecx,%ecx
mov    0x60(%rsp),%rdx
cmp    %rdx,(%rsp)
setne  %cl
shl    $0x5,%ecx
test   %eax,%eax
cmove  %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fs_mr_create(i64 %0, i64 %1, i64 %2, i32* %3, i32 %4, i32 %5, i32 %6, i64 %7, i64 %8, i64 %9, i64 %10) {
%12 = alloca i32
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i32*
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i64
%21 = alloca i64
%22 = alloca i64
%23 = alloca i64
%24 = alloca i64
%25 = alloca i32
store i64 %0, i64* %13
store i64 %1, i64* %14
store i64 %2, i64* %15
store i32* %3, i32** %16
store i32 %4, i32* %17
store i32 %5, i32* %18
store i32 %6, i32* %19
store i64 %7, i64* %20
store i64 %8, i64* %21
store i64 %9, i64* %22
store i64 %10, i64* %23
%26 = load i32, i32* %17
%27 = icmp sgt i32 %26, 15
br i1 %27, label %28, label %31
28: ; preds = %11
%29 = load i32, i32* %17
%30 = call i32 @fsnodes_type_convert(i32 %29)
store i32 %30, i32* %17
br label %31
31: ; preds = %28, %11
%32 = load i64, i64* %13
%33 = load i64, i64* %14
%34 = load i64, i64* %15
%35 = load i32*, i32** %16
%36 = load i32, i32* %17
%37 = load i32, i32* %18
%38 = load i32, i32* %19
%39 = load i64, i64* %20
%40 = load i64, i64* %22
%41 = call i32 @fs_univ_create(i64 %32, i32 0, i32 128, i64 %33, i64 %34, i32* %35, i32 %36, i32 %37, i32 %38, i64 %39, i32 1, i64* %21, i32 0, i32 0, i64 %40, i32 0, i64* %24, i32* null)
store i32 %41, i32* %25
%42 = load i32, i32* %25
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %31
%45 = load i32, i32* %25
store i32 %45, i32* %12
br label %52
46: ; preds = %31
%47 = load i64, i64* %24
%48 = load i64, i64* %23
%49 = icmp ne i64 %47, %48
br i1 %49, label %50, label %51
50: ; preds = %46
store i32 32, i32* %12
br label %52
51: ; preds = %46
store i32 0, i32* %12
br label %52
52: ; preds = %51, %50, %44
%53 = load i32, i32* %12
ret i32 %53
}

LLVM IR (-O2):
define i32 @fs_mr_create(i64 %0, i64 %1, i64 %2, i32* %3, i32 %4, i32 %5, i32 %6, i64 %7, i64 %8, i64 %9, i64 %10) {
%12 = alloca i64
%13 = alloca i64
store i64 %8, i64* %12
%14 = bitcast i64* %13 to i8*
%15 = icmp sgt i32 %4, 15
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = tail call i32 @fsnodes_type_convert(i32 %4)
br label %18
18: ; preds = %16, %11
%19 = phi i32 [ %17, %16 ], [ %4, %11 ]
%20 = call i32 @fs_univ_create(i64 %0, i32 0, i32 128, i64 %1, i64 %2, i32* %3, i32 %19, i32 %5, i32 %6, i64 %7, i32 1, i64* %12, i32 0, i32 0, i64 %9, i32 0, i64* %13, i32* null)
%21 = icmp eq i32 %20, 0
%22 = load i64, i64* %13
%23 = icmp eq i64 %22, %10
%24 = select i1 %23, i32 0, i32 32
%25 = select i1 %21, i32 %24, i32 %20
ret i32 %25
}