#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 UARTFIFOLevelGet(unsigned long ulBase, unsigned long *pulTxLevel,
                      unsigned long *pulRxLevel) {
  unsigned long ulTemp;
  {
    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",
          288);
    }
  };
  ulTemp = (*((volatile unsigned long *)(ulBase + 0x00000034)));
  *pulTxLevel = ulTemp & 0x00000007;
  *pulRxLevel = ulTemp & 0x00000038;
}


x86 assembly (clang, -O0):
<UARTFIFOLevelGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
cmp    $0x0,%eax
jne    1157 <UARTFIFOLevelGet+0x37>
lea    0xeb3(%rip),%rdi
mov    $0x120,%esi
call   1030 <AssertFailure@plt>
mov    -0x8(%rbp),%rax
mov    0x34(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
and    $0x7,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
and    $0x38,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFIFOLevelGet>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <UARTBaseValid@plt>
test   %eax,%eax
jne    1148 <UARTFIFOLevelGet+0x28>
lea    0xec2(%rip),%rdi
mov    $0x120,%esi
call   1030 <AssertFailure@plt>
mov    0x34(%rbx),%rax
mov    %eax,%ecx
and    $0x7,%ecx
mov    %rcx,(%r15)
and    $0x38,%eax
mov    %rax,(%r14)
pop    %rbx
pop    %r14
pop    %r15
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 @UARTFIFOLevelGet(i64 %0, i64* %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca i64
store i64 %0, i64* %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%8 = load i64, i64* %4
%9 = call i32 @UARTBaseValid(i64 %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %3
%12 = call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 288)
br label %13
13: ; preds = %11, %3
%14 = load i64, i64* %4
%15 = add i64 %14, 52
%16 = inttoptr i64 %15 to i64*
%17 = load volatile i64, i64* %16
store i64 %17, i64* %7
%18 = load i64, i64* %7
%19 = and i64 %18, 7
%20 = load i64*, i64** %5
store i64 %19, i64* %20
%21 = load i64, i64* %7
%22 = and i64 %21, 56
%23 = load i64*, i64** %6
store i64 %22, i64* %23
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 @UARTFIFOLevelGet(i64 %0, i64* nocapture writeonly %1, i64* nocapture writeonly %2) {
%4 = tail call i32 @UARTBaseValid(i64 %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 288)
br label %8
8: ; preds = %6, %3
%9 = add i64 %0, 52
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = and i64 %11, 7
store i64 %12, i64* %1
%13 = and i64 %11, 56
store i64 %13, i64* %2
ret void
}