#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 UARTDisable(unsigned long ulBase) {
  {
    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_LM3S6965_Crossworks/Boot/lib/driverlib/"
          "uartlib.c",
          534);
    }
  };
  while ((*((volatile unsigned long *)(ulBase + 0x00000018))) & 0x00000008) {
  }
  (*((volatile unsigned long *)(ulBase + 0x0000002C))) &= ~(0x00000010);
  (*((volatile unsigned long *)(ulBase + 0x00000030))) &=
      ~(0x00000001 | 0x00000100 | 0x00000200);
}


x86 assembly (clang, -O0):
<UARTDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
cmp    $0x0,%eax
jne    114f <UARTDisable+0x2f>
lea    0xebb(%rip),%rdi
mov    $0x216,%esi
call   1030 <AssertFailure@plt>
jmp    1154 <UARTDisable+0x34>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
and    $0x8,%rax
cmp    $0x0,%rax
je     116f <UARTDisable+0x4f>
jmp    1154 <UARTDisable+0x34>
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%rcx
and    $0xffffffffffffffef,%rcx
mov    %rcx,0x2c(%rax)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rcx
and    $0xfffffffffffffcfe,%rcx
mov    %rcx,0x30(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTDisable>:
push   %rbx
mov    %rdi,%rbx
call   1040 <UARTBaseValid@plt>
test   %eax,%eax
jne    1140 <UARTDisable+0x20>
lea    0xecc(%rip),%rdi
mov    $0x216,%esi
call   1030 <AssertFailure@plt>
xchg   %ax,%ax
testq  $0x8,0x18(%rbx)
jne    1140 <UARTDisable+0x20>
andq   $0xffffffffffffffef,0x2c(%rbx)
andq   $0xfffffffffffffcfe,0x30(%rbx)
ff
pop    %rbx
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_LM3S6965_Crossworks/Boot/lib/driverlib/uartlib.c\00"
define void @UARTDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @UARTBaseValid(i64 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 534)
br label %8
8: ; preds = %6, %1
br label %9
9: ; preds = %16, %8
%10 = load i64, i64* %2
%11 = add i64 %10, 24
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, 8
%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* %2
%19 = add i64 %18, 44
%20 = inttoptr i64 %19 to i64*
%21 = load volatile i64, i64* %20
%22 = and i64 %21, -17
store volatile i64 %22, i64* %20
%23 = load i64, i64* %2
%24 = add i64 %23, 48
%25 = inttoptr i64 %24 to i64*
%26 = load volatile i64, i64* %25
%27 = and i64 %26, -770
store volatile i64 %27, i64* %25
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_LM3S6965_Crossworks/Boot/lib/driverlib/uartlib.c\00"
define void @UARTDisable(i64 %0) {
%2 = tail call i32 @UARTBaseValid(i64 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 534)
br label %6
6: ; preds = %4, %1
%7 = add i64 %0, 24
%8 = inttoptr i64 %7 to i64*
br label %9
9: ; preds = %9, %6
%10 = load volatile i64, i64* %8
%11 = and i64 %10, 8
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %9
13: ; preds = %9
%14 = add i64 %0, 44
%15 = inttoptr i64 %14 to i64*
%16 = load volatile i64, i64* %15
%17 = and i64 %16, -17
store volatile i64 %17, i64* %15
%18 = add i64 %0, 48
%19 = inttoptr i64 %18 to i64*
%20 = load volatile i64, i64* %19
%21 = and i64 %20, -770
store volatile i64 %21, i64* %19
ret void
}