#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 /*<<< orphan*/);
int /*<<< orphan*/ UARTBaseValid(unsigned long);
void UART9BitAddrSend(unsigned long ulBase, unsigned char ucAddr) {
  unsigned long ulLCRH;
  DEBUG_ASSERT(UARTBaseValid(ulBase));
  while ((*((volatile unsigned long *)(ulBase + 0x00000018))) &
         (0x00000080 | 0x00000008)) {
  }
  ulLCRH = (*((volatile unsigned long *)(ulBase + 0x0000002C)));
  (*((volatile unsigned long *)(ulBase + 0x0000002C))) =
      ((ulLCRH & ~0x00000004) | 0x00000080 | 0x00000002);
  (*((volatile unsigned long *)(ulBase + 0x00000000))) = ucAddr;
  while ((*((volatile unsigned long *)(ulBase + 0x00000018))) &
         (0x00000080 | 0x00000008)) {
  }
  (*((volatile unsigned long *)(ulBase + 0x0000002C))) = ulLCRH;
}


x86 assembly (clang, -O0):
<UART9BitAddrSend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
and    $0x88,%rax
cmp    $0x0,%rax
je     115f <UART9BitAddrSend+0x3f>
jmp    1142 <UART9BitAddrSend+0x22>
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
and    $0xfffffffffffffffb,%rcx
or     $0x80,%rcx
or     $0x2,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x2c(%rax)
movzbl -0x9(%rbp),%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
and    $0x88,%rax
cmp    $0x0,%rax
je     11b0 <UART9BitAddrSend+0x90>
jmp    1193 <UART9BitAddrSend+0x73>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x2c(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART9BitAddrSend>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
testq  $0x88,0x18(%rbx)
jne    1140 <UART9BitAddrSend+0x20>
mov    0x2c(%rbx),%rax
mov    %rax,%rcx
and    $0xffffffffffffff79,%rcx
or     $0x82,%rcx
mov    %rcx,0x2c(%rbx)
movzbl %bpl,%ecx
mov    %rcx,(%rbx)
nopw   0x0(%rax,%rax,1)
testq  $0x88,0x18(%rbx)
jne    1170 <UART9BitAddrSend+0x50>
mov    %rax,0x2c(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @UART9BitAddrSend(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
%5 = alloca i64
store i64 %0, i64* %3
store i8 %1, i8* %4
%6 = load i64, i64* %3
%7 = call i32 @UARTBaseValid(i64 %6)
%8 = call i32 @DEBUG_ASSERT(i32 %7)
br label %9
9: ; preds = %16, %2
%10 = load i64, i64* %3
%11 = add i64 %10, 24
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, 136
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %9
br label %9
17: ; preds = %9
%18 = load i64, i64* %3
%19 = add i64 %18, 44
%20 = inttoptr i64 %19 to i64*
%21 = load volatile i64, i64* %20
store i64 %21, i64* %5
%22 = load i64, i64* %5
%23 = and i64 %22, -5
%24 = or i64 %23, 128
%25 = or i64 %24, 2
%26 = load i64, i64* %3
%27 = add i64 %26, 44
%28 = inttoptr i64 %27 to i64*
store volatile i64 %25, i64* %28
%29 = load i8, i8* %4
%30 = zext i8 %29 to i64
%31 = load i64, i64* %3
%32 = add i64 %31, 0
%33 = inttoptr i64 %32 to i64*
store volatile i64 %30, i64* %33
br label %34
34: ; preds = %41, %17
%35 = load i64, i64* %3
%36 = add i64 %35, 24
%37 = inttoptr i64 %36 to i64*
%38 = load volatile i64, i64* %37
%39 = and i64 %38, 136
%40 = icmp ne i64 %39, 0
br i1 %40, label %41, label %42
41: ; preds = %34
br label %34
42: ; preds = %34
%43 = load i64, i64* %5
%44 = load i64, i64* %3
%45 = add i64 %44, 44
%46 = inttoptr i64 %45 to i64*
store volatile i64 %43, i64* %46
ret void
}

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