#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 */

/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int SSIBaseValid(unsigned long);
void SSIDataPut(unsigned long ulBase, unsigned long ulData) {
  DEBUG_ASSERT(SSIBaseValid(ulBase));
  DEBUG_ASSERT(
      (ulData &
       (0xfffffffe << ((*((volatile unsigned long *)(ulBase + 0x00000000))) &
                       0x0000000F))) == 0);
  while (!((*((volatile unsigned long *)(ulBase + 0x0000000C))) & 0x00000002)) {
  }
  (*((volatile unsigned long *)(ulBase + 0x00000008))) = ulData;
}


x86 assembly (clang, -O0):
<SSIDataPut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <SSIBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
and    $0xf,%rcx
mov    $0xfffffffe,%edx
shl    %cl,%edx
mov    %edx,%ecx
mov    %ecx,%ecx
and    %rcx,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rax
and    $0x2,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1190 <SSIDataPut+0x70>
jmp    1195 <SSIDataPut+0x75>
jmp    116e <SSIDataPut+0x4e>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIDataPut>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <SSIBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    (%rbx),%rcx
and    $0xf,%cl
mov    %r14d,%eax
shr    %cl,%eax
xor    %edi,%edi
test   $0xfffffffe,%eax
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
testq  $0x2,0xc(%rbx)
je     1160 <SSIDataPut+0x40>
mov    %r14,0x8(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @SSIDataPut(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i32 @SSIBaseValid(i64 %5)
%7 = call i32 @DEBUG_ASSERT(i32 %6)
%8 = load i64, i64* %4
%9 = load i64, i64* %3
%10 = add i64 %9, 0
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = and i64 %12, 15
%14 = trunc i64 %13 to i32
%15 = shl i32 -2, %14
%16 = zext i32 %15 to i64
%17 = and i64 %8, %16
%18 = icmp eq i64 %17, 0
%19 = zext i1 %18 to i32
%20 = call i32 @DEBUG_ASSERT(i32 %19)
br label %21
21: ; preds = %29, %2
%22 = load i64, i64* %3
%23 = add i64 %22, 12
%24 = inttoptr i64 %23 to i64*
%25 = load volatile i64, i64* %24
%26 = and i64 %25, 2
%27 = icmp ne i64 %26, 0
%28 = xor i1 %27, true
br i1 %28, label %29, label %30
29: ; preds = %21
br label %21
30: ; preds = %21
%31 = load i64, i64* %4
%32 = load i64, i64* %3
%33 = add i64 %32, 8
%34 = inttoptr i64 %33 to i64*
store volatile i64 %31, i64* %34
ret void
}

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