#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 uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _UARTBaseValid(int);
void UART9BitAddrSend(uint32_t ui32Base, uint8_t ui8Addr) {
  uint32_t ui32LCRH;
  ASSERT(_UARTBaseValid(ui32Base));
  while (((*((volatile uint32_t *)(ui32Base + 0x00000018))) &
          (0x00000080 | 0x00000008)) != 0x00000080) {
  }
  ui32LCRH = (*((volatile uint32_t *)(ui32Base + 0x0000002C)));
  (*((volatile uint32_t *)(ui32Base + 0x0000002C))) =
      ((ui32LCRH & ~0x00000004) | 0x00000080 | 0x00000002);
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) = ui8Addr;
  while (((*((volatile uint32_t *)(ui32Base + 0x00000018))) &
          (0x00000080 | 0x00000008)) != 0x00000080) {
  }
  (*((volatile uint32_t *)(ui32Base + 0x0000002C))) = ui32LCRH;
}


x86 assembly (clang, -O0):
<UART9BitAddrSend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x18,%eax
cltq
mov    (%rax),%eax
and    $0x88,%eax
cmp    $0x80,%eax
je     115c <UART9BitAddrSend+0x3c>
jmp    113d <UART9BitAddrSend+0x1d>
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xfffffffb,%ecx
or     $0x80,%ecx
or     $0x2,%ecx
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x18,%eax
cltq
mov    (%rax),%eax
and    $0x88,%eax
cmp    $0x80,%eax
je     11ae <UART9BitAddrSend+0x8e>
jmp    118f <UART9BitAddrSend+0x6f>
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART9BitAddrSend>:
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,%rax
mov    $0x88,%ecx
nopl   0x0(%rax,%rax,1)
mov    0x18(%rax),%edx
and    %ecx,%edx
cmp    $0x80,%edx
jne    1140 <UART9BitAddrSend+0x20>
mov    0x2c(%rax),%ecx
mov    %ecx,%edx
and    $0xffffff79,%edx
or     $0x82,%edx
mov    %edx,0x2c(%rax)
mov    %ebx,(%rax)
mov    $0x88,%edx
nopl   0x0(%rax,%rax,1)
mov    0x18(%rax),%esi
and    %edx,%esi
cmp    $0x80,%esi
jne    1170 <UART9BitAddrSend+0x50>
mov    %ecx,0x2c(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @UART9BitAddrSend(i32 %0, i32 %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*
br label %8
8: ; preds = %8, %2
%9 = load volatile i32, i32* %7
%10 = and i32 %9, 136
%11 = icmp eq i32 %10, 128
br i1 %11, label %12, label %8
12: ; preds = %8
%13 = add nsw i32 %0, 44
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = and i32 %16, -135
%18 = or i32 %17, 130
store volatile i32 %18, i32* %15
%19 = sext i32 %0 to i64
%20 = inttoptr i64 %19 to i32*
store volatile i32 %1, i32* %20
br label %21
21: ; preds = %21, %12
%22 = load volatile i32, i32* %7
%23 = and i32 %22, 136
%24 = icmp eq i32 %23, 128
br i1 %24, label %25, label %21
25: ; preds = %21
store volatile i32 %16, i32* %15
ret void
}