#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;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
int _SSIBaseValid(int);
void SSIDataPut(uint32_t ui32Base, uint32_t ui32Data) {
  ASSERT(_SSIBaseValid(ui32Base));
  ASSERT((ui32Data &
          (0xfffffffe << ((*((volatile uint32_t *)(ui32Base + 0x00000000))) &
                          0x0000000F))) == 0);
  while (!((*((volatile uint32_t *)(ui32Base + 0x0000000C))) & 0x00000002)) {
  }
  (*((volatile uint32_t *)(ui32Base + 0x00000008))) = ui32Data;
}


x86 assembly (clang, -O0):
<SSIDataPut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_SSIBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x8(%rbp),%eax
mov    -0x4(%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    -0x4(%rbp),%eax
add    $0xc,%eax
cltq
mov    (%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    118b <SSIDataPut+0x6b>
jmp    1190 <SSIDataPut+0x70>
jmp    1169 <SSIDataPut+0x49>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x8,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIDataPut>:
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>
testl  $0x2,0xc(%rbp)
je     1150 <SSIDataPut+0x30>
mov    %ebx,0x8(%rbp)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @SSIDataPut(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*
br label %17
17: ; preds = %17, %2
%18 = load volatile i32, i32* %16
%19 = and i32 %18, 2
%20 = icmp eq i32 %19, 0
br i1 %20, label %17, label %21
21: ; preds = %17
%22 = add nsw i32 %0, 8
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to i32*
store volatile i32 %1, i32* %24
ret void
}