#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 */
unsigned int UARTRegConfigModeEnable(unsigned int, int);
void UARTXONAnyFeatureControl(unsigned int baseAdd, unsigned int controlFlag) {
  unsigned int lcrRegValue = 0;
  unsigned int enhanFnBitVal = 0;
  lcrRegValue = UARTRegConfigModeEnable(baseAdd, (0x00BF));
  enhanFnBitVal =
      ((*((volatile unsigned int *)(baseAdd + (0x8)))) & (0x00000010u));
  (*((volatile unsigned int *)(baseAdd + (0x8)))) |= (0x00000010u);
  (*((volatile unsigned int *)(baseAdd + (0x10)))) &= ~((0x00000020u));
  (*((volatile unsigned int *)(baseAdd + (0x10)))) |=
      (controlFlag & (0x00000020u));
  (*((volatile unsigned int *)(baseAdd + (0x8)))) &= ~((0x00000010u));
  (*((volatile unsigned int *)(baseAdd + (0x8)))) |= enhanFnBitVal;
  (*((volatile unsigned int *)(baseAdd + (0xC)))) = lcrRegValue;
}


x86 assembly (clang, -O0):
<UARTXONAnyFeatureControl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xbf,%esi
call   1030 <UARTRegConfigModeEnable@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x8,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x10,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x8,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x10,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffffffdf,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
and    $0x20,%edx
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x8,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffffffef,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%edx
mov    -0x4(%rbp),%eax
add    $0x8,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0xc,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTXONAnyFeatureControl>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0xbf,%esi
call   1030 <UARTRegConfigModeEnable@plt>
lea    0x8(%rbx),%ecx
mov    (%rcx),%edx
orl    $0x10,(%rcx)
lea    0x10(%rbx),%esi
andl   $0xffffffdf,(%rsi)
and    $0x20,%ebp
or     %ebp,(%rsi)
andl   $0xffffffef,(%rcx)
and    $0x10,%edx
or     %edx,(%rcx)
add    $0xc,%ebx
mov    %eax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @UARTXONAnyFeatureControl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%7 = load i32, i32* %3
%8 = call i32 @UARTRegConfigModeEnable(i32 %7, i32 191)
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = add i32 %9, 8
%11 = zext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
%14 = and i32 %13, 16
store i32 %14, i32* %6
%15 = load i32, i32* %3
%16 = add i32 %15, 8
%17 = zext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
%19 = load volatile i32, i32* %18
%20 = or i32 %19, 16
store volatile i32 %20, i32* %18
%21 = load i32, i32* %3
%22 = add i32 %21, 16
%23 = zext i32 %22 to i64
%24 = inttoptr i64 %23 to i32*
%25 = load volatile i32, i32* %24
%26 = and i32 %25, -33
store volatile i32 %26, i32* %24
%27 = load i32, i32* %4
%28 = and i32 %27, 32
%29 = load i32, i32* %3
%30 = add i32 %29, 16
%31 = zext i32 %30 to i64
%32 = inttoptr i64 %31 to i32*
%33 = load volatile i32, i32* %32
%34 = or i32 %33, %28
store volatile i32 %34, i32* %32
%35 = load i32, i32* %3
%36 = add i32 %35, 8
%37 = zext i32 %36 to i64
%38 = inttoptr i64 %37 to i32*
%39 = load volatile i32, i32* %38
%40 = and i32 %39, -17
store volatile i32 %40, i32* %38
%41 = load i32, i32* %6
%42 = load i32, i32* %3
%43 = add i32 %42, 8
%44 = zext i32 %43 to i64
%45 = inttoptr i64 %44 to i32*
%46 = load volatile i32, i32* %45
%47 = or i32 %46, %41
store volatile i32 %47, i32* %45
%48 = load i32, i32* %5
%49 = load i32, i32* %3
%50 = add i32 %49, 12
%51 = zext i32 %50 to i64
%52 = inttoptr i64 %51 to i32*
store volatile i32 %48, i32* %52
ret void
}

LLVM IR (-O2):
define void @UARTXONAnyFeatureControl(i32 %0, i32 %1) {
%3 = tail call i32 @UARTRegConfigModeEnable(i32 %0, i32 191)
%4 = add i32 %0, 8
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 16
%9 = load volatile i32, i32* %6
%10 = or i32 %9, 16
store volatile i32 %10, i32* %6
%11 = add i32 %0, 16
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, -33
store volatile i32 %15, i32* %13
%16 = and i32 %1, 32
%17 = load volatile i32, i32* %13
%18 = or i32 %17, %16
store volatile i32 %18, i32* %13
%19 = load volatile i32, i32* %6
%20 = and i32 %19, -17
store volatile i32 %20, i32* %6
%21 = load volatile i32, i32* %6
%22 = or i32 %21, %8
store volatile i32 %22, i32* %6
%23 = add i32 %0, 12
%24 = zext i32 %23 to i64
%25 = inttoptr i64 %24 to i32*
store volatile i32 %3, i32* %25
ret void
}