#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 /*<<< orphan*/);
int /*<<< orphan*/ _UARTBaseValid(int);
bool UARTCharPutNonBlocking(uint32_t ui32Base, unsigned char ucData) {
  ASSERT(_UARTBaseValid(ui32Base));
  if (!((*((volatile uint32_t *)(ui32Base + 0x00000018))) & 0x00000020)) {
    (*((volatile uint32_t *)(ui32Base + 0x00000000))) = ucData;
    return (true);
  } else {
    return (false);
  }
}


x86 assembly (clang, -O0):
<UARTCharPutNonBlocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x8(%rbp),%eax
add    $0x18,%eax
cltq
mov    (%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
jne    1170 <UARTCharPutNonBlocking+0x50>
movzbl -0x9(%rbp),%ecx
mov    -0x8(%rbp),%eax
add    $0x0,%eax
cltq
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1177 <UARTCharPutNonBlocking+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTCharPutNonBlocking>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
movslq %ebp,%rcx
xor    %eax,%eax
testl  $0x20,0x18(%rcx)
jne    114b <UARTCharPutNonBlocking+0x2b>
movzbl %bl,%eax
mov    %eax,(%rcx)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @UARTCharPutNonBlocking(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %4
store i8 %1, i8* %5
%6 = load i32, i32* %4
%7 = call i32 @_UARTBaseValid(i32 %6)
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 24
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
%14 = and i32 %13, 32
%15 = icmp ne i32 %14, 0
br i1 %15, label %23, label %16
16: ; preds = %2
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 0
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
store volatile i32 %18, 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 @UARTCharPutNonBlocking(i32 %0, i8 zeroext %1) {
%3 = tail call i32 @_UARTBaseValid(i32 %0)
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 24
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 32
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = zext i8 %1 to i32
%13 = sext i32 %0 to i64
%14 = inttoptr i64 %13 to i32*
store volatile i32 %12, i32* %14
br label %15
15: ; preds = %2, %11
%16 = phi i32 [ 1, %11 ], [ 0, %2 ]
ret i32 %16
}