#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 uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
int _UARTBaseValid(int);
void UARTParityModeSet(uint32_t ui32Base, uint32_t ui32Parity) {
  ASSERT(_UARTBaseValid(ui32Base));
  ASSERT((ui32Parity == 0x00000000) || (ui32Parity == 0x00000006) ||
         (ui32Parity == 0x00000002) || (ui32Parity == 0x00000082) ||
         (ui32Parity == 0x00000086));
  (*((volatile uint32_t *)(ui32Base + 0x0000002C))) =
      (((*((volatile uint32_t *)(ui32Base + 0x0000002C))) &
        ~(0x00000080 | 0x00000004 | 0x00000002)) |
       ui32Parity);
}


x86 assembly (clang, -O0):
<UARTParityModeSet>:
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    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1189 <UARTParityModeSet+0x69>
mov    $0x1,%al
cmpl   $0x6,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1189 <UARTParityModeSet+0x69>
mov    $0x1,%al
cmpl   $0x2,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1189 <UARTParityModeSet+0x69>
mov    $0x1,%al
cmpl   $0x82,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1189 <UARTParityModeSet+0x69>
cmpl   $0x86,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    (%rax),%ecx
and    $0xffffff79,%ecx
or     -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTParityModeSet>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    $0x1,%edi
cmp    $0x6,%ebx
ja     1147 <UARTParityModeSet+0x27>
mov    $0x45,%eax
bt     %ebx,%eax
jb     115b <UARTParityModeSet+0x3b>
cmp    $0x82,%ebx
je     115b <UARTParityModeSet+0x3b>
xor    %edi,%edi
cmp    $0x86,%ebx
sete   %dil
call   1040 <ASSERT@plt>
movslq %ebp,%rax
mov    $0xffffff79,%ecx
and    0x2c(%rax),%ecx
or     %ebx,%ecx
mov    %ecx,0x2c(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @UARTParityModeSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @_UARTBaseValid(i32 %5)
%7 = call i32 @ASSERT(i32 %6)
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 0
br i1 %9, label %22, label %10
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 6
br i1 %12, label %22, label %13
13: ; preds = %10
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 2
br i1 %15, label %22, label %16
16: ; preds = %13
%17 = load i32, i32* %4
%18 = icmp eq i32 %17, 130
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = load i32, i32* %4
%21 = icmp eq i32 %20, 134
br label %22
22: ; preds = %19, %16, %13, %10, %2
%23 = phi i1 [ true, %16 ], [ true, %13 ], [ true, %10 ], [ true, %2 ], [ %21, %19 ]
%24 = zext i1 %23 to i32
%25 = call i32 @ASSERT(i32 %24)
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 44
%28 = sext i32 %27 to i64
%29 = inttoptr i64 %28 to i32*
%30 = load volatile i32, i32* %29
%31 = and i32 %30, -135
%32 = load i32, i32* %4
%33 = or i32 %31, %32
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 44
%36 = sext i32 %35 to i64
%37 = inttoptr i64 %36 to i32*
store volatile i32 %33, i32* %37
ret void
}

LLVM IR (-O2):
define void @UARTParityModeSet(i32 %0, i32 %1) {
%3 = tail call i32 @_UARTBaseValid(i32 %0)
%4 = tail call i32 @ASSERT(i32 %3)
switch i32 %1, label %5 [
i32 130, label %8
i32 6, label %8
i32 2, label %8
i32 0, label %8
]
5: ; preds = %2
%6 = icmp eq i32 %1, 134
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %2, %2, %2, %2, %5
%9 = phi i32 [ 1, %2 ], [ %7, %5 ], [ 1, %2 ], [ 1, %2 ], [ 1, %2 ]
%10 = tail call i32 @ASSERT(i32 %9)
%11 = add nsw i32 %0, 44
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, -135
%16 = or i32 %15, %1
store volatile i32 %16, i32* %13
ret void
}