#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);
int _SSIBaseValid(int);
int32_t SSIDataPutNonBlocking(uint32_t ui32Base, uint32_t ui32Data) {
  ASSERT(_SSIBaseValid(ui32Base));
  ASSERT((ui32Data &
          (0xfffffffe << ((*((volatile uint32_t *)(ui32Base + 0x00000000))) &
                          0x0000000F))) == 0);
  if ((*((volatile uint32_t *)(ui32Base + 0x0000000C))) & 0x00000002) {
    (*((volatile uint32_t *)(ui32Base + 0x00000008))) = ui32Data;
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<SSIDataPutNonBlocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <_SSIBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    (%rcx),%ecx
and    $0xf,%ecx
mov    $0xfffffffe,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <ASSERT@plt>
mov    -0x8(%rbp),%eax
add    $0xc,%eax
cltq
mov    (%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1198 <SSIDataPutNonBlocking+0x78>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
add    $0x8,%eax
cltq
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    119f <SSIDataPutNonBlocking+0x7f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIDataPutNonBlocking>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <_SSIBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
movslq %ebp,%rbp
mov    0x0(%rbp),%ecx
and    $0xf,%cl
mov    %ebx,%eax
shr    %cl,%eax
xor    %edi,%edi
test   $0xfffffffe,%eax
sete   %dil
call   1040 <ASSERT@plt>
xor    %eax,%eax
testl  $0x2,0xc(%rbp)
je     1163 <SSIDataPutNonBlocking+0x43>
mov    %ebx,0x8(%rbp)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @SSIDataPutNonBlocking(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* %5
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 0
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, 15
%16 = shl i32 -2, %15
%17 = and i32 %9, %16
%18 = icmp eq i32 %17, 0
%19 = zext i1 %18 to i32
%20 = call i32 @ASSERT(i32 %19)
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 12
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to i32*
%25 = load volatile i32, i32* %24
%26 = and i32 %25, 2
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %34
28: ; preds = %2
%29 = load i32, i32* %5
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 8
%32 = sext i32 %31 to i64
%33 = inttoptr i64 %32 to i32*
store volatile i32 %29, i32* %33
store i32 1, i32* %3
br label %35
34: ; preds = %2
store i32 0, i32* %3
br label %35
35: ; preds = %34, %28
%36 = load i32, i32* %3
ret i32 %36
}

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