#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 */
unsigned int UARTRegConfigModeEnable(unsigned int, int);
unsigned int UARTCharPutNonBlocking(unsigned int baseAdd,
                                    unsigned char byteWrite) {
  unsigned int lcrRegValue = 0;
  unsigned int retVal = 0;
  lcrRegValue = UARTRegConfigModeEnable(baseAdd, (0x007F));
  if ((*((volatile unsigned int *)(baseAdd + (0x14)))) &
      ((0x00000040u) | (0x00000020u))) {
    (*((volatile unsigned int *)(baseAdd + (0x0)))) = byteWrite;
    retVal = 1;
  }
  (*((volatile unsigned int *)(baseAdd + (0xC)))) = lcrRegValue;
  return retVal;
}


x86 assembly (clang, -O0):
<UARTCharPutNonBlocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x7f,%esi
call   1030 <UARTRegConfigModeEnable@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x14,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x60,%eax
cmp    $0x0,%eax
je     116a <UARTCharPutNonBlocking+0x5a>
movzbl -0x5(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x0,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
movl   $0x1,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0xc,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTCharPutNonBlocking>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x7f,%esi
call   1030 <UARTRegConfigModeEnable@plt>
lea    0x14(%rbx),%ecx
testl  $0x60,(%rcx)
je     113b <UARTCharPutNonBlocking+0x2b>
movzbl %bpl,%ecx
mov    %ebx,%edx
mov    %ecx,(%rdx)
mov    $0x1,%ecx
jmp    113d <UARTCharPutNonBlocking+0x2d>
xor    %ecx,%ecx
add    $0xc,%ebx
mov    %eax,(%rbx)
mov    %ecx,%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 i8
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8 %1, i8* %4
store i32 0, i32* %5
store i32 0, i32* %6
%7 = load i32, i32* %3
%8 = call i32 @UARTRegConfigModeEnable(i32 %7, i32 127)
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = add i32 %9, 20
%11 = zext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
%14 = and i32 %13, 96
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %23
16: ; preds = %2
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = load i32, i32* %3
%20 = add i32 %19, 0
%21 = zext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
store volatile i32 %18, i32* %22
store i32 1, i32* %6
br label %23
23: ; preds = %16, %2
%24 = load i32, i32* %5
%25 = load i32, i32* %3
%26 = add i32 %25, 12
%27 = zext i32 %26 to i64
%28 = inttoptr i64 %27 to i32*
store volatile i32 %24, i32* %28
%29 = load i32, i32* %6
ret i32 %29
}

LLVM IR (-O2):
define i32 @UARTCharPutNonBlocking(i32 %0, i8 zeroext %1) {
%3 = tail call i32 @UARTRegConfigModeEnable(i32 %0, i32 127)
%4 = add i32 %0, 20
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 96
%9 = icmp eq i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = zext i8 %1 to i32
%12 = zext i32 %0 to i64
%13 = inttoptr i64 %12 to i32*
store volatile i32 %11, i32* %13
br label %14
14: ; preds = %10, %2
%15 = phi i32 [ 1, %10 ], [ 0, %2 ]
%16 = add i32 %0, 12
%17 = zext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
store volatile i32 %3, i32* %18
ret i32 %15
}