#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*/ AssertFailure(char *, int);
int /*<<< orphan*/ UARTBaseValid(unsigned long);
void UARTCharPut(unsigned long ulBase, unsigned char ucData) {
  {
    if (!(UARTBaseValid(ulBase))) {
      AssertFailure(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/"
          "Demo/ARMCM3_LM3S_EK_LM3S8962_Crossworks/Boot/lib/driverlib/"
          "uartlib.c",
          1161);
    }
  };
  while ((*((volatile unsigned long *)(ulBase + 0x00000018))) & 0x00000020) {
  }
  (*((volatile unsigned long *)(ulBase + 0x00000000))) = ucData;
}


x86 assembly (clang, -O0):
<UARTCharPut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
cmp    $0x0,%eax
jne    1155 <UARTCharPut+0x35>
lea    0xeb5(%rip),%rdi
mov    $0x489,%esi
call   1030 <AssertFailure@plt>
jmp    115a <UARTCharPut+0x3a>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
and    $0x20,%rax
cmp    $0x0,%rax
je     1175 <UARTCharPut+0x55>
jmp    115a <UARTCharPut+0x3a>
movzbl -0x9(%rbp),%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTCharPut>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <UARTBaseValid@plt>
test   %eax,%eax
jne    1150 <UARTCharPut+0x30>
lea    0xec8(%rip),%rdi
mov    $0x489,%esi
call   1030 <AssertFailure@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
testq  $0x20,0x18(%rbx)
jne    1150 <UARTCharPut+0x30>
movzbl %bpl,%eax
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [201 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S8962_Crossworks/Boot/lib/driverlib/uartlib.c\00"
define void @UARTCharPut(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
%6 = call i32 @UARTBaseValid(i64 %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 1161)
br label %10
10: ; preds = %8, %2
br label %11
11: ; preds = %18, %10
%12 = load i64, i64* %3
%13 = add i64 %12, 24
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
%16 = and i64 %15, 32
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %11
br label %11
19: ; preds = %11
%20 = load i8, i8* %4
%21 = zext i8 %20 to i64
%22 = load i64, i64* %3
%23 = add i64 %22, 0
%24 = inttoptr i64 %23 to i64*
store volatile i64 %21, i64* %24
ret void
}

LLVM IR (-O2):
@.str = [201 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S8962_Crossworks/Boot/lib/driverlib/uartlib.c\00"
define void @UARTCharPut(i64 %0, i8 zeroext %1) {
%3 = tail call i32 @UARTBaseValid(i64 %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 1161)
br label %7
7: ; preds = %5, %2
%8 = add i64 %0, 24
%9 = inttoptr i64 %8 to i64*
br label %10
10: ; preds = %10, %7
%11 = load volatile i64, i64* %9
%12 = and i64 %11, 32
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %10
14: ; preds = %10
%15 = zext i8 %1 to i64
%16 = inttoptr i64 %0 to i64*
store volatile i64 %15, i64* %16
ret void
}