#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);
void UARTCharPut(unsigned int baseAdd, unsigned char byteTx) {
  unsigned int lcrRegValue = 0;
  lcrRegValue = UARTRegConfigModeEnable(baseAdd, (0x007F));
  while (((0x00000040u) | (0x00000020u)) !=
         ((*((volatile unsigned int *)(baseAdd + (0x14)))) &
          ((0x00000040u) | (0x00000020u))))
    ;
  (*((volatile unsigned int *)(baseAdd + (0x0)))) = byteTx;
  (*((volatile unsigned int *)(baseAdd + (0xC)))) = lcrRegValue;
}


x86 assembly (clang, -O0):
<UARTCharPut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movl   $0x0,-0xc(%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),%ecx
and    $0x60,%ecx
mov    $0x60,%eax
cmp    %ecx,%eax
je     1157 <UARTCharPut+0x47>
jmp    1138 <UARTCharPut+0x28>
movzbl -0x5(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x0,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0xc,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTCharPut>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x7f,%esi
call   1030 <UARTRegConfigModeEnable@plt>
lea    0x14(%rbx),%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rcx),%edx
not    %edx
test   $0x60,%dl
jne    1130 <UARTCharPut+0x20>
movzbl %bpl,%ecx
mov    %ebx,%edx
mov    %ecx,(%rdx)
add    $0xc,%ebx
mov    %eax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @UARTCharPut(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
store i32 %0, i32* %3
store i8 %1, i8* %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = call i32 @UARTRegConfigModeEnable(i32 %6, i32 127)
store i32 %7, i32* %5
br label %8
8: ; preds = %16, %2
%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 96, %14
br i1 %15, label %16, label %17
16: ; preds = %8
br label %8
17: ; preds = %8
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = load i32, i32* %3
%21 = add i32 %20, 0
%22 = zext i32 %21 to i64
%23 = inttoptr i64 %22 to i32*
store volatile i32 %19, i32* %23
%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
ret void
}

LLVM IR (-O2):
define void @UARTCharPut(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*
br label %7
7: ; preds = %7, %2
%8 = load volatile i32, i32* %6
%9 = and i32 %8, 96
%10 = icmp eq i32 %9, 96
br i1 %10, label %11, label %7
11: ; preds = %7
%12 = zext i8 %1 to i32
%13 = zext i32 %0 to i64
%14 = inttoptr i64 %13 to i32*
store volatile i32 %12, i32* %14
%15 = add i32 %0, 12
%16 = zext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
store volatile i32 %3, i32* %17
ret void
}