void IPCLiteCtoMSetBits(unsigned long ulFlag, unsigned long ulStatusFlag) {
  unsigned short *pusAddress;
  unsigned long *pulAddress;
  while (
      !((*((volatile unsigned long *)(0x400FB700 + 0x000000004))) & ulFlag)) {
  }
  if ((*((volatile unsigned long *)(0x400FB700 + 0x000000020))) == 0x00000001) {
    pusAddress = (unsigned short *)(*(
        (volatile unsigned long *)(0x400FB700 + 0x000000024)));
    *pusAddress |= (unsigned short)(*(
        (volatile unsigned long *)(0x400FB700 + 0x000000028)));
    (*((volatile unsigned long *)(0x400FB700 + 0x00000002C))) =
        (unsigned long)*pusAddress;
    (*((volatile unsigned long *)(0x400FB700 + 0x000000000))) |=
        (ulStatusFlag | ulFlag);
  } else if ((*((volatile unsigned long *)(0x400FB700 + 0x000000020))) ==
             0x00000002) {
    pulAddress = (unsigned long *)(*(
        (volatile unsigned long *)(0x400FB700 + 0x000000024)));
    *pulAddress |= (unsigned long)(*(
        (volatile unsigned long *)(0x400FB700 + 0x000000028)));
    (*((volatile unsigned long *)(0x400FB700 + 0x00000002C))) = *pulAddress;
    (*((volatile unsigned long *)(0x400FB700 + 0x000000000))) |=
        (ulStatusFlag | ulFlag);
  } else {
    (*((volatile unsigned long *)(0x400FB700 + 0x000000000))) |= (ulFlag);
  }
}


x86 assembly (clang, -O0):
<IPCLiteCtoMSetBits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x400fb704,%eax
mov    (%rax),%rax
and    -0x8(%rbp),%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112e <IPCLiteCtoMSetBits+0x2e>
jmp    1133 <IPCLiteCtoMSetBits+0x33>
jmp    110c <IPCLiteCtoMSetBits+0xc>
mov    $0x400fb720,%eax
mov    (%rax),%rax
cmp    $0x1,%rax
jne    1199 <IPCLiteCtoMSetBits+0x99>
mov    $0x400fb724,%eax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    $0x400fb728,%eax
mov    (%rax),%rax
movzwl %ax,%edx
mov    -0x18(%rbp),%rax
movzwl (%rax),%ecx
or     %edx,%ecx
mov    %cx,(%rax)
mov    -0x18(%rbp),%rax
movzwl (%rax),%eax
mov    %eax,%ecx
mov    $0x400fb72c,%eax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
or     -0x8(%rbp),%rax
mov    $0x400fb700,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x400fb700,%eax
mov    %rcx,(%rax)
jmp    1214 <IPCLiteCtoMSetBits+0x114>
mov    $0x400fb720,%eax
mov    (%rax),%rax
cmp    $0x2,%rax
jne    11f8 <IPCLiteCtoMSetBits+0xf8>
mov    $0x400fb724,%eax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    $0x400fb728,%eax
mov    (%rax),%rcx
mov    -0x20(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
mov    $0x400fb72c,%eax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
or     -0x8(%rbp),%rax
mov    $0x400fb700,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x400fb700,%eax
mov    %rcx,(%rax)
jmp    120f <IPCLiteCtoMSetBits+0x10f>
mov    -0x8(%rbp),%rax
mov    $0x400fb700,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x400fb700,%eax
mov    %rcx,(%rax)
jmp    1214 <IPCLiteCtoMSetBits+0x114>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IPCLiteCtoMSetBits>:
mov    0x400fb704,%rax
40
and    %rdi,%rax
je     1100 <IPCLiteCtoMSetBits>
mov    0x400fb720,%rax
40
cmp    $0x1,%rax
jne    1136 <IPCLiteCtoMSetBits+0x36>
mov    0x400fb724,%rax
40
mov    0x400fb728,%rcx
40
or     (%rax),%cx
movzwl %cx,%ecx
mov    %cx,(%rax)
jmp    115a <IPCLiteCtoMSetBits+0x5a>
mov    0x400fb720,%rax
40
cmp    $0x2,%rax
jne    116f <IPCLiteCtoMSetBits+0x6f>
mov    0x400fb724,%rax
40
mov    0x400fb728,%rcx
40
or     (%rax),%rcx
mov    %rcx,(%rax)
mov    %rcx,0x400fb72c
40
or     %rdi,%rsi
mov    0x400fb700,%rdi
40
jmp    1177 <IPCLiteCtoMSetBits+0x77>
mov    0x400fb700,%rsi
40
or     %rsi,%rdi
mov    %rdi,0x400fb700
40
ret

LLVM IR (-O0):
define void @IPCLiteCtoMSetBits(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i16*
%6 = alloca i64*
store i64 %0, i64* %3
store i64 %1, i64* %4
br label %7
7: ; preds = %13, %2
%8 = load volatile i64, i64* inttoptr (i64 1074771716 to i64*)
%9 = load i64, i64* %3
%10 = and i64 %8, %9
%11 = icmp ne i64 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %14
13: ; preds = %7
br label %7
14: ; preds = %7
%15 = load volatile i64, i64* inttoptr (i64 1074771744 to i64*)
%16 = icmp eq i64 %15, 1
br i1 %16, label %17, label %36
17: ; preds = %14
%18 = load volatile i64, i64* inttoptr (i64 1074771748 to i64*)
%19 = inttoptr i64 %18 to i16*
store i16* %19, i16** %5
%20 = load volatile i64, i64* inttoptr (i64 1074771752 to i64*)
%21 = trunc i64 %20 to i16
%22 = zext i16 %21 to i32
%23 = load i16*, i16** %5
%24 = load i16, i16* %23
%25 = zext i16 %24 to i32
%26 = or i32 %25, %22
%27 = trunc i32 %26 to i16
store i16 %27, i16* %23
%28 = load i16*, i16** %5
%29 = load i16, i16* %28
%30 = zext i16 %29 to i64
store volatile i64 %30, i64* inttoptr (i64 1074771756 to i64*)
%31 = load i64, i64* %4
%32 = load i64, i64* %3
%33 = or i64 %31, %32
%34 = load volatile i64, i64* inttoptr (i64 1074771712 to i64*)
%35 = or i64 %34, %33
store volatile i64 %35, i64* inttoptr (i64 1074771712 to i64*)
br label %58
36: ; preds = %14
%37 = load volatile i64, i64* inttoptr (i64 1074771744 to i64*)
%38 = icmp eq i64 %37, 2
br i1 %38, label %39, label %53
39: ; preds = %36
%40 = load volatile i64, i64* inttoptr (i64 1074771748 to i64*)
%41 = inttoptr i64 %40 to i64*
store i64* %41, i64** %6
%42 = load volatile i64, i64* inttoptr (i64 1074771752 to i64*)
%43 = load i64*, i64** %6
%44 = load i64, i64* %43
%45 = or i64 %44, %42
store i64 %45, i64* %43
%46 = load i64*, i64** %6
%47 = load i64, i64* %46
store volatile i64 %47, i64* inttoptr (i64 1074771756 to i64*)
%48 = load i64, i64* %4
%49 = load i64, i64* %3
%50 = or i64 %48, %49
%51 = load volatile i64, i64* inttoptr (i64 1074771712 to i64*)
%52 = or i64 %51, %50
store volatile i64 %52, i64* inttoptr (i64 1074771712 to i64*)
br label %57
53: ; preds = %36
%54 = load i64, i64* %3
%55 = load volatile i64, i64* inttoptr (i64 1074771712 to i64*)
%56 = or i64 %55, %54
store volatile i64 %56, i64* inttoptr (i64 1074771712 to i64*)
br label %57
57: ; preds = %53, %39
br label %58
58: ; preds = %57, %17
ret void
}

LLVM IR (-O2):
define void @IPCLiteCtoMSetBits(i64 %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = load volatile i64, i64* inttoptr (i64 1074771716 to i64*)
%5 = and i64 %4, %0
%6 = icmp eq i64 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
%8 = load volatile i64, i64* inttoptr (i64 1074771744 to i64*)
%9 = icmp eq i64 %8, 1
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load volatile i64, i64* inttoptr (i64 1074771748 to i64*)
%12 = inttoptr i64 %11 to i16*
%13 = load volatile i64, i64* inttoptr (i64 1074771752 to i64*)
%14 = trunc i64 %13 to i16
%15 = load i16, i16* %12
%16 = or i16 %15, %14
store i16 %16, i16* %12
%17 = zext i16 %16 to i64
store volatile i64 %17, i64* inttoptr (i64 1074771756 to i64*)
%18 = or i64 %1, %0
%19 = load volatile i64, i64* inttoptr (i64 1074771712 to i64*)
br label %33
20: ; preds = %7
%21 = load volatile i64, i64* inttoptr (i64 1074771744 to i64*)
%22 = icmp eq i64 %21, 2
br i1 %22, label %23, label %31
23: ; preds = %20
%24 = load volatile i64, i64* inttoptr (i64 1074771748 to i64*)
%25 = inttoptr i64 %24 to i64*
%26 = load volatile i64, i64* inttoptr (i64 1074771752 to i64*)
%27 = load i64, i64* %25
%28 = or i64 %27, %26
store i64 %28, i64* %25
store volatile i64 %28, i64* inttoptr (i64 1074771756 to i64*)
%29 = or i64 %1, %0
%30 = load volatile i64, i64* inttoptr (i64 1074771712 to i64*)
br label %33
31: ; preds = %20
%32 = load volatile i64, i64* inttoptr (i64 1074771712 to i64*)
br label %33
33: ; preds = %23, %31, %10
%34 = phi i64 [ %30, %23 ], [ %0, %31 ], [ %19, %10 ]
%35 = phi i64 [ %29, %23 ], [ %32, %31 ], [ %18, %10 ]
%36 = or i64 %35, %34
store volatile i64 %36, i64* inttoptr (i64 1074771712 to i64*)
ret void
}