#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 unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t SHAMD5IntStatus(uint32_t ui32Base, bool bMasked) {
  uint32_t ui32Temp;
  uint32_t ui32IrqEnable;
  ;
  if (bMasked) {
    ui32Temp = (*((volatile unsigned long *)(0x44030000 + 0x00000818)));
    ui32IrqEnable = (*((volatile unsigned long *)(ui32Base + 0x0000011C)));
    return (((*((volatile unsigned long *)(ui32Base + 0x00000118))) &
             ui32IrqEnable) |
            (ui32Temp & 0x00000007) << 16);
  } else {
    ui32Temp = (*((volatile unsigned long *)(0x44030000 + 0x00000814)));
    return ((*((volatile unsigned long *)(ui32Base + 0x00000118))) |
            (ui32Temp & 0x00000007) << 16);
  }
}


x86 assembly (clang, -O0):
<SHAMD5IntStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     115a <SHAMD5IntStatus+0x5a>
mov    $0x44030818,%eax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x11c(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x118(%rax),%rax
mov    -0x28(%rbp),%rcx
and    %rcx,%rax
mov    -0x20(%rbp),%rcx
and    $0x7,%rcx
shl    $0x10,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1184 <SHAMD5IntStatus+0x84>
mov    $0x44030814,%eax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x118(%rax),%rax
mov    -0x20(%rbp),%rcx
and    $0x7,%rcx
shl    $0x10,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAMD5IntStatus>:
mov    %rdi,-0x18(%rsp)
test   %esi,%esi
je     113a <SHAMD5IntStatus+0x3a>
mov    0x44030818,%rax
44
mov    %rax,-0x10(%rsp)
mov    -0x18(%rsp),%rax
mov    0x11c(%rax),%rax
mov    %rax,-0x8(%rsp)
mov    -0x18(%rsp),%rax
mov    0x118(%rax),%rcx
and    -0x8(%rsp),%rcx
jmp    1153 <SHAMD5IntStatus+0x53>
mov    0x44030814,%rax
44
mov    %rax,-0x10(%rsp)
mov    -0x18(%rsp),%rax
mov    0x118(%rax),%rcx
mov    -0x10(%rsp),%rax
and    $0x7,%eax
shl    $0x10,%rax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @SHAMD5IntStatus(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64
store volatile i64 %0, i64* %4
store i32 %1, i32* %5
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %26
10: ; preds = %2
%11 = load volatile i64, i64* inttoptr (i64 1141049368 to i64*)
store volatile i64 %11, i64* %6
%12 = load volatile i64, i64* %4
%13 = add i64 %12, 284
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
store volatile i64 %15, i64* %7
%16 = load volatile i64, i64* %4
%17 = add i64 %16, 280
%18 = inttoptr i64 %17 to i64*
%19 = load volatile i64, i64* %18
%20 = load volatile i64, i64* %7
%21 = and i64 %19, %20
%22 = load volatile i64, i64* %6
%23 = and i64 %22, 7
%24 = shl i64 %23, 16
%25 = or i64 %21, %24
store i64 %25, i64* %3
br label %36
26: ; preds = %2
%27 = load volatile i64, i64* inttoptr (i64 1141049364 to i64*)
store volatile i64 %27, i64* %6
%28 = load volatile i64, i64* %4
%29 = add i64 %28, 280
%30 = inttoptr i64 %29 to i64*
%31 = load volatile i64, i64* %30
%32 = load volatile i64, i64* %6
%33 = and i64 %32, 7
%34 = shl i64 %33, 16
%35 = or i64 %31, %34
store i64 %35, i64* %3
br label %36
36: ; preds = %26, %10
%37 = load i64, i64* %3
ret i64 %37
}

LLVM IR (-O2):
define i64 @SHAMD5IntStatus(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store volatile i64 %0, i64* %3
%6 = bitcast i64* %4 to i8*
%7 = bitcast i64* %5 to i8*
%8 = icmp eq i32 %1, 0
br i1 %8, label %21, label %9
9: ; preds = %2
%10 = load volatile i64, i64* inttoptr (i64 1141049368 to i64*)
store volatile i64 %10, i64* %4
%11 = load volatile i64, i64* %3
%12 = add i64 %11, 284
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
store volatile i64 %14, i64* %5
%15 = load volatile i64, i64* %3
%16 = add i64 %15, 280
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
%19 = load volatile i64, i64* %5
%20 = and i64 %19, %18
br label %27
21: ; preds = %2
%22 = load volatile i64, i64* inttoptr (i64 1141049364 to i64*)
store volatile i64 %22, i64* %4
%23 = load volatile i64, i64* %3
%24 = add i64 %23, 280
%25 = inttoptr i64 %24 to i64*
%26 = load volatile i64, i64* %25
br label %27
27: ; preds = %21, %9
%28 = phi i64 [ %26, %21 ], [ %20, %9 ]
%29 = load volatile i64, i64* %4
%30 = shl i64 %29, 16
%31 = and i64 %30, 458752
%32 = or i64 %31, %28
ret i64 %32
}