void IPCLiteCtoMClearBits(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))) == 0x00000003) {
    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))) ==
             0x00000004) {
    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):
<IPCLiteCtoMClearBits>:
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 <IPCLiteCtoMClearBits+0x2e>
jmp    1133 <IPCLiteCtoMClearBits+0x33>
jmp    110c <IPCLiteCtoMClearBits+0xc>
mov    $0x400fb720,%eax
mov    (%rax),%rax
cmp    $0x3,%rax
jne    119c <IPCLiteCtoMClearBits+0x9c>
mov    $0x400fb724,%eax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    $0x400fb728,%eax
mov    (%rax),%rax
movzwl %ax,%edx
xor    $0xffffffff,%edx
mov    -0x18(%rbp),%rax
movzwl (%rax),%ecx
and    %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    121b <IPCLiteCtoMClearBits+0x11b>
mov    $0x400fb720,%eax
mov    (%rax),%rax
cmp    $0x4,%rax
jne    11ff <IPCLiteCtoMClearBits+0xff>
mov    $0x400fb724,%eax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    $0x400fb728,%eax
mov    (%rax),%rcx
xor    $0xffffffffffffffff,%rcx
mov    -0x20(%rbp),%rax
and    (%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    1216 <IPCLiteCtoMClearBits+0x116>
mov    -0x8(%rbp),%rax
mov    $0x400fb700,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x400fb700,%eax
mov    %rcx,(%rax)
jmp    121b <IPCLiteCtoMClearBits+0x11b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IPCLiteCtoMClearBits>:
mov    0x400fb704,%rax
40
and    %rdi,%rax
je     1100 <IPCLiteCtoMClearBits>
mov    0x400fb720,%rax
40
cmp    $0x3,%rax
jne    1138 <IPCLiteCtoMClearBits+0x38>
mov    0x400fb724,%rax
40
mov    0x400fb728,%rcx
40
not    %ecx
and    (%rax),%cx
movzwl %cx,%ecx
mov    %cx,(%rax)
jmp    115f <IPCLiteCtoMClearBits+0x5f>
mov    0x400fb720,%rax
40
cmp    $0x4,%rax
jne    1174 <IPCLiteCtoMClearBits+0x74>
mov    0x400fb724,%rax
40
mov    0x400fb728,%rcx
40
not    %rcx
and    (%rax),%rcx
mov    %rcx,(%rax)
mov    %rcx,0x400fb72c
40
or     %rdi,%rsi
mov    0x400fb700,%rdi
40
jmp    117c <IPCLiteCtoMClearBits+0x7c>
mov    0x400fb700,%rsi
40
or     %rsi,%rdi
mov    %rdi,0x400fb700
40
ret

LLVM IR (-O0):
define void @IPCLiteCtoMClearBits(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, 3
br i1 %16, label %17, label %37
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 = xor i32 %22, -1
%24 = load i16*, i16** %5
%25 = load i16, i16* %24
%26 = zext i16 %25 to i32
%27 = and i32 %26, %23
%28 = trunc i32 %27 to i16
store i16 %28, i16* %24
%29 = load i16*, i16** %5
%30 = load i16, i16* %29
%31 = zext i16 %30 to i64
store volatile i64 %31, i64* inttoptr (i64 1074771756 to i64*)
%32 = load i64, i64* %4
%33 = load i64, i64* %3
%34 = or i64 %32, %33
%35 = load volatile i64, i64* inttoptr (i64 1074771712 to i64*)
%36 = or i64 %35, %34
store volatile i64 %36, i64* inttoptr (i64 1074771712 to i64*)
br label %60
37: ; preds = %14
%38 = load volatile i64, i64* inttoptr (i64 1074771744 to i64*)
%39 = icmp eq i64 %38, 4
br i1 %39, label %40, label %55
40: ; preds = %37
%41 = load volatile i64, i64* inttoptr (i64 1074771748 to i64*)
%42 = inttoptr i64 %41 to i64*
store i64* %42, i64** %6
%43 = load volatile i64, i64* inttoptr (i64 1074771752 to i64*)
%44 = xor i64 %43, -1
%45 = load i64*, i64** %6
%46 = load i64, i64* %45
%47 = and i64 %46, %44
store i64 %47, i64* %45
%48 = load i64*, i64** %6
%49 = load i64, i64* %48
store volatile i64 %49, i64* inttoptr (i64 1074771756 to i64*)
%50 = load i64, i64* %4
%51 = load i64, i64* %3
%52 = or i64 %50, %51
%53 = load volatile i64, i64* inttoptr (i64 1074771712 to i64*)
%54 = or i64 %53, %52
store volatile i64 %54, i64* inttoptr (i64 1074771712 to i64*)
br label %59
55: ; preds = %37
%56 = load i64, i64* %3
%57 = load volatile i64, i64* inttoptr (i64 1074771712 to i64*)
%58 = or i64 %57, %56
store volatile i64 %58, i64* inttoptr (i64 1074771712 to i64*)
br label %59
59: ; preds = %55, %40
br label %60
60: ; preds = %59, %17
ret void
}

LLVM IR (-O2):
define void @IPCLiteCtoMClearBits(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, 3
br i1 %9, label %10, label %21
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 = xor i16 %14, -1
%16 = load i16, i16* %12
%17 = and i16 %16, %15
store i16 %17, i16* %12
%18 = zext i16 %17 to i64
store volatile i64 %18, i64* inttoptr (i64 1074771756 to i64*)
%19 = or i64 %1, %0
%20 = load volatile i64, i64* inttoptr (i64 1074771712 to i64*)
br label %35
21: ; preds = %7
%22 = load volatile i64, i64* inttoptr (i64 1074771744 to i64*)
%23 = icmp eq i64 %22, 4
br i1 %23, label %24, label %33
24: ; preds = %21
%25 = load volatile i64, i64* inttoptr (i64 1074771748 to i64*)
%26 = inttoptr i64 %25 to i64*
%27 = load volatile i64, i64* inttoptr (i64 1074771752 to i64*)
%28 = xor i64 %27, -1
%29 = load i64, i64* %26
%30 = and i64 %29, %28
store i64 %30, i64* %26
store volatile i64 %30, i64* inttoptr (i64 1074771756 to i64*)
%31 = or i64 %1, %0
%32 = load volatile i64, i64* inttoptr (i64 1074771712 to i64*)
br label %35
33: ; preds = %21
%34 = load volatile i64, i64* inttoptr (i64 1074771712 to i64*)
br label %35
35: ; preds = %24, %33, %10
%36 = phi i64 [ %32, %24 ], [ %0, %33 ], [ %20, %10 ]
%37 = phi i64 [ %31, %24 ], [ %34, %33 ], [ %19, %10 ]
%38 = or i64 %37, %36
store volatile i64 %38, i64* inttoptr (i64 1074771712 to i64*)
ret void
}