void IPCLiteCtoMDataRead(unsigned long ulFlag, unsigned long ulStatusFlag) {
  unsigned long *pulRAddress;
  unsigned short *pusRAddress;
  while (
      !((*((volatile unsigned long *)(0x400FB700 + 0x000000004))) & ulFlag)) {
  }
  if ((*((volatile unsigned long *)(0x400FB700 + 0x000000020))) == 0x00000007) {
    pusRAddress = (unsigned short *)(*(
        (volatile unsigned long *)(0x400FB700 + 0x000000024)));
    (*((volatile unsigned long *)(0x400FB700 + 0x00000002C))) =
        (unsigned long)(*pusRAddress);
    (*((volatile unsigned long *)(0x400FB700 + 0x000000000))) |=
        (ulStatusFlag | ulFlag);
  } else if ((*((volatile unsigned long *)(0x400FB700 + 0x000000020))) ==
             0x00000008) {
    pulRAddress = (unsigned long *)(*(
        (volatile unsigned long *)(0x400FB700 + 0x000000024)));
    (*((volatile unsigned long *)(0x400FB700 + 0x00000002C))) = *pulRAddress;
    (*((volatile unsigned long *)(0x400FB700 + 0x000000000))) |=
        (ulStatusFlag | ulFlag);
  } else {
    (*((volatile unsigned long *)(0x400FB700 + 0x000000000))) |= (ulFlag);
  }
}


x86 assembly (clang, -O0):
<IPCLiteCtoMDataRead>:
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 <IPCLiteCtoMDataRead+0x2e>
jmp    1133 <IPCLiteCtoMDataRead+0x33>
jmp    110c <IPCLiteCtoMDataRead+0xc>
mov    $0x400fb720,%eax
mov    (%rax),%rax
cmp    $0x7,%rax
jne    1182 <IPCLiteCtoMDataRead+0x82>
mov    $0x400fb724,%eax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%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    11eb <IPCLiteCtoMDataRead+0xeb>
mov    $0x400fb720,%eax
mov    (%rax),%rax
cmp    $0x8,%rax
jne    11cf <IPCLiteCtoMDataRead+0xcf>
mov    $0x400fb724,%eax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%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    11e6 <IPCLiteCtoMDataRead+0xe6>
mov    -0x8(%rbp),%rax
mov    $0x400fb700,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x400fb700,%eax
mov    %rcx,(%rax)
jmp    11eb <IPCLiteCtoMDataRead+0xeb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IPCLiteCtoMDataRead>:
mov    0x400fb704,%rax
40
and    %rdi,%rax
je     1100 <IPCLiteCtoMDataRead>
mov    0x400fb720,%rax
40
cmp    $0x7,%rax
jne    1128 <IPCLiteCtoMDataRead+0x28>
mov    0x400fb724,%rax
40
movzwl (%rax),%eax
jmp    1141 <IPCLiteCtoMDataRead+0x41>
mov    0x400fb720,%rax
40
cmp    $0x8,%rax
jne    1156 <IPCLiteCtoMDataRead+0x56>
mov    0x400fb724,%rax
40
mov    (%rax),%rax
mov    %rax,0x400fb72c
40
or     %rdi,%rsi
mov    0x400fb700,%rdi
40
jmp    115e <IPCLiteCtoMDataRead+0x5e>
mov    0x400fb700,%rsi
40
or     %rsi,%rdi
mov    %rdi,0x400fb700
40
ret

LLVM IR (-O0):
define void @IPCLiteCtoMDataRead(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64*
%6 = alloca i16*
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, 7
br i1 %16, label %17, label %28
17: ; preds = %14
%18 = load volatile i64, i64* inttoptr (i64 1074771748 to i64*)
%19 = inttoptr i64 %18 to i16*
store i16* %19, i16** %6
%20 = load i16*, i16** %6
%21 = load i16, i16* %20
%22 = zext i16 %21 to i64
store volatile i64 %22, i64* inttoptr (i64 1074771756 to i64*)
%23 = load i64, i64* %4
%24 = load i64, i64* %3
%25 = or i64 %23, %24
%26 = load volatile i64, i64* inttoptr (i64 1074771712 to i64*)
%27 = or i64 %26, %25
store volatile i64 %27, i64* inttoptr (i64 1074771712 to i64*)
br label %46
28: ; preds = %14
%29 = load volatile i64, i64* inttoptr (i64 1074771744 to i64*)
%30 = icmp eq i64 %29, 8
br i1 %30, label %31, label %41
31: ; preds = %28
%32 = load volatile i64, i64* inttoptr (i64 1074771748 to i64*)
%33 = inttoptr i64 %32 to i64*
store i64* %33, i64** %5
%34 = load i64*, i64** %5
%35 = load i64, i64* %34
store volatile i64 %35, i64* inttoptr (i64 1074771756 to i64*)
%36 = load i64, i64* %4
%37 = load i64, i64* %3
%38 = or i64 %36, %37
%39 = load volatile i64, i64* inttoptr (i64 1074771712 to i64*)
%40 = or i64 %39, %38
store volatile i64 %40, i64* inttoptr (i64 1074771712 to i64*)
br label %45
41: ; preds = %28
%42 = load i64, i64* %3
%43 = load volatile i64, i64* inttoptr (i64 1074771712 to i64*)
%44 = or i64 %43, %42
store volatile i64 %44, i64* inttoptr (i64 1074771712 to i64*)
br label %45
45: ; preds = %41, %31
br label %46
46: ; preds = %45, %17
ret void
}

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