#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 int uint32_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _SSIBaseValid(int);
int32_t SSIDataGetNonBlocking(uint32_t ui32Base, uint32_t *pui32Data) {
  ASSERT(_SSIBaseValid(ui32Base));
  if ((*((volatile uint32_t *)(ui32Base + 0x0000000C))) & 0x00000004) {
    *pui32Data = (*((volatile uint32_t *)(ui32Base + 0x00000008)));
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<SSIDataGetNonBlocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <_SSIBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x8(%rbp),%eax
add    $0xc,%eax
cltq
mov    (%rax),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1170 <SSIDataGetNonBlocking+0x50>
mov    -0x8(%rbp),%eax
add    $0x8,%eax
cltq
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1177 <SSIDataGetNonBlocking+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIDataGetNonBlocking>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <_SSIBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
movslq %ebp,%rcx
xor    %eax,%eax
testl  $0x4,0xc(%rcx)
je     114c <SSIDataGetNonBlocking+0x2c>
mov    0x8(%rcx),%eax
mov    %eax,(%rbx)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @SSIDataGetNonBlocking(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
%6 = load i32, i32* %4
%7 = call i32 @_SSIBaseValid(i32 %6)
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 12
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
%14 = and i32 %13, 4
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %23
16: ; preds = %2
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 8
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
%21 = load volatile i32, i32* %20
%22 = load i32*, i32** %5
store i32 %21, i32* %22
store i32 1, i32* %3
br label %24
23: ; preds = %2
store i32 0, i32* %3
br label %24
24: ; preds = %23, %16
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @SSIDataGetNonBlocking(i32 %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @_SSIBaseValid(i32 %0)
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 12
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 4
%10 = icmp eq i32 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %2
%12 = add nsw i32 %0, 8
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
%15 = load volatile i32, i32* %14
store i32 %15, i32* %1
br label %16
16: ; preds = %2, %11
%17 = phi i32 [ 1, %11 ], [ 0, %2 ]
ret i32 %17
}