#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 UARTParityModeSet(unsigned long ulBase, unsigned long ulParity) {
  {
    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",
          96);
    }
  };
  {
    if (!((ulParity == 0x00000000) || (ulParity == 0x00000006) ||
          (ulParity == 0x00000002) || (ulParity == 0x00000082) ||
          (ulParity == 0x00000086))) {
      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",
          97);
    }
  };
  (*((volatile unsigned long *)(ulBase + 0x0000002C))) =
      (((*((volatile unsigned long *)(ulBase + 0x0000002C))) &
        ~(0x00000080 | 0x00000004 | 0x00000002)) |
       ulParity);
}


x86 assembly (clang, -O0):
<UARTParityModeSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
cmp    $0x0,%eax
jne    1153 <UARTParityModeSet+0x33>
lea    0xeb7(%rip),%rdi
mov    $0x60,%esi
call   1030 <AssertFailure@plt>
cmpq   $0x0,-0x10(%rbp)
je     11a1 <UARTParityModeSet+0x81>
cmpq   $0x6,-0x10(%rbp)
je     11a1 <UARTParityModeSet+0x81>
cmpq   $0x2,-0x10(%rbp)
je     11a1 <UARTParityModeSet+0x81>
cmpq   $0x82,-0x10(%rbp)
je     11a1 <UARTParityModeSet+0x81>
cmpq   $0x86,-0x10(%rbp)
je     11a1 <UARTParityModeSet+0x81>
lea    0xe69(%rip),%rdi
mov    $0x61,%esi
call   1030 <AssertFailure@plt>
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%rcx
and    $0xffffffffffffff79,%rcx
or     -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x2c(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTParityModeSet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <UARTBaseValid@plt>
test   %eax,%eax
je     113b <UARTParityModeSet+0x1b>
cmp    $0x6,%rbx
jbe    1152 <UARTParityModeSet+0x32>
jmp    115d <UARTParityModeSet+0x3d>
lea    0xebe(%rip),%rdi
mov    $0x60,%esi
call   1030 <AssertFailure@plt>
cmp    $0x6,%rbx
ja     115d <UARTParityModeSet+0x3d>
mov    $0x45,%eax
bt     %rbx,%rax
jb     1180 <UARTParityModeSet+0x60>
cmp    $0x82,%rbx
je     1180 <UARTParityModeSet+0x60>
cmp    $0x86,%rbx
je     1180 <UARTParityModeSet+0x60>
lea    0xe8a(%rip),%rdi
mov    $0x61,%esi
call   1030 <AssertFailure@plt>
mov    $0xffffffffffffff79,%rax
and    0x2c(%r14),%rax
or     %rbx,%rax
mov    %rax,0x2c(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
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 @UARTParityModeSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %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 96)
br label %10
10: ; preds = %8, %2
%11 = load i64, i64* %4
%12 = icmp eq i64 %11, 0
br i1 %12, label %27, label %13
13: ; preds = %10
%14 = load i64, i64* %4
%15 = icmp eq i64 %14, 6
br i1 %15, label %27, label %16
16: ; preds = %13
%17 = load i64, i64* %4
%18 = icmp eq i64 %17, 2
br i1 %18, label %27, label %19
19: ; preds = %16
%20 = load i64, i64* %4
%21 = icmp eq i64 %20, 130
br i1 %21, label %27, label %22
22: ; preds = %19
%23 = load i64, i64* %4
%24 = icmp eq i64 %23, 134
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 97)
br label %27
27: ; preds = %25, %22, %19, %16, %13, %10
%28 = load i64, i64* %3
%29 = add i64 %28, 44
%30 = inttoptr i64 %29 to i64*
%31 = load volatile i64, i64* %30
%32 = and i64 %31, -135
%33 = load i64, i64* %4
%34 = or i64 %32, %33
%35 = load i64, i64* %3
%36 = add i64 %35, 44
%37 = inttoptr i64 %36 to i64*
store volatile i64 %34, i64* %37
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 @UARTParityModeSet(i64 %0, i64 %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 96)
br label %7
7: ; preds = %5, %2
switch i64 %1, label %8 [
i64 134, label %10
i64 130, label %10
i64 6, label %10
i64 2, label %10
i64 0, label %10
]
8: ; preds = %7
%9 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 97)
br label %10
10: ; preds = %7, %7, %7, %7, %7, %8
%11 = add i64 %0, 44
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, -135
%15 = or i64 %14, %1
store volatile i64 %15, i64* %12
ret void
}