unsigned short IPCLiteMtoCFunctionCall(unsigned long ulFlag,
                                       unsigned long ulAddress,
                                       unsigned long ulParam,
                                       unsigned long ulStatusFlag) {
  unsigned short returnStatus;
  if ((*((volatile unsigned long *)(0x400FB700 + 0x000000010))) &
      (ulFlag | ulStatusFlag)) {
    returnStatus = 0x0001;
  } else {
    (*((volatile unsigned long *)(0x400FB700 + 0x000000030))) = 0x00000012;
    (*((volatile unsigned long *)(0x400FB700 + 0x000000034))) = ulAddress;
    (*((volatile unsigned long *)(0x400FB700 + 0x000000038))) = ulParam;
    (*((volatile unsigned long *)(0x400FB700 + 0x000000008))) |=
        (ulFlag | ulStatusFlag);
    returnStatus = 0x0000;
  }
  return returnStatus;
}


x86 assembly (clang, -O0):
<IPCLiteMtoCFunctionCall>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x400fb710,%eax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
or     -0x20(%rbp),%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     113c <IPCLiteMtoCFunctionCall+0x3c>
movw   $0x1,-0x22(%rbp)
jmp    1181 <IPCLiteMtoCFunctionCall+0x81>
mov    $0x400fb730,%eax
movq   $0x12,(%rax)
mov    -0x10(%rbp),%rcx
mov    $0x400fb734,%eax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    $0x400fb738,%eax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
or     -0x20(%rbp),%rax
mov    $0x400fb708,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x400fb708,%eax
mov    %rcx,(%rax)
movw   $0x0,-0x22(%rbp)
movzwl -0x22(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IPCLiteMtoCFunctionCall>:
or     %rcx,%rdi
mov    0x400fb710,%rcx
40
mov    $0x1,%ax
and    %rdi,%rcx
je     1115 <IPCLiteMtoCFunctionCall+0x15>
ret
movq   $0x12,0x400fb730
mov    %rsi,0x400fb734
40
mov    %rdx,0x400fb738
40
or     %rdi,0x400fb708
40
xor    %eax,%eax
ret

LLVM IR (-O0):
define zeroext i16 @IPCLiteMtoCFunctionCall(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i16
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load volatile i64, i64* inttoptr (i64 1074771728 to i64*)
%11 = load i64, i64* %5
%12 = load i64, i64* %8
%13 = or i64 %11, %12
%14 = and i64 %10, %13
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %4
store i16 1, i16* %9
br label %25
17: ; preds = %4
store volatile i64 18, i64* inttoptr (i64 1074771760 to i64*)
%18 = load i64, i64* %6
store volatile i64 %18, i64* inttoptr (i64 1074771764 to i64*)
%19 = load i64, i64* %7
store volatile i64 %19, i64* inttoptr (i64 1074771768 to i64*)
%20 = load i64, i64* %5
%21 = load i64, i64* %8
%22 = or i64 %20, %21
%23 = load volatile i64, i64* inttoptr (i64 1074771720 to i64*)
%24 = or i64 %23, %22
store volatile i64 %24, i64* inttoptr (i64 1074771720 to i64*)
store i16 0, i16* %9
br label %25
25: ; preds = %17, %16
%26 = load i16, i16* %9
ret i16 %26
}

LLVM IR (-O2):
define zeroext i16 @IPCLiteMtoCFunctionCall(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = load volatile i64, i64* inttoptr (i64 1074771728 to i64*)
%6 = or i64 %3, %0
%7 = and i64 %5, %6
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
store volatile i64 18, i64* inttoptr (i64 1074771760 to i64*)
store volatile i64 %1, i64* inttoptr (i64 1074771764 to i64*)
store volatile i64 %2, i64* inttoptr (i64 1074771768 to i64*)
%10 = load volatile i64, i64* inttoptr (i64 1074771720 to i64*)
%11 = or i64 %10, %6
store volatile i64 %11, i64* inttoptr (i64 1074771720 to i64*)
br label %12
12: ; preds = %4, %9
%13 = phi i16 [ 0, %9 ], [ 1, %4 ]
ret i16 %13
}