#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 UARTTCRTLRBitValRestore(unsigned int baseAdd, unsigned int tcrTlrBitVal) {
  unsigned int enhanFnBitVal = 0;
  unsigned int lcrRegValue = 0;
  lcrRegValue = UARTRegConfigModeEnable(baseAdd, (0x00BF));
  enhanFnBitVal =
      (*((volatile unsigned int *)(baseAdd + (0x8)))) & (0x00000010u);
  (*((volatile unsigned int *)(baseAdd + (0x8)))) |= (0x00000010u);
  UARTRegConfigModeEnable(baseAdd, (0x0080));
  (*((volatile unsigned int *)(baseAdd + (0x10)))) &= ~((0x00000040u));
  (*((volatile unsigned int *)(baseAdd + (0x10)))) |=
      (tcrTlrBitVal & (0x00000040u));
  UARTRegConfigModeEnable(baseAdd, (0x00BF));
  (*((volatile unsigned int *)(baseAdd + (0x8)))) &= ~((0x00000010u));
  (*((volatile unsigned int *)(baseAdd + (0x8)))) |= enhanFnBitVal;
  (*((volatile unsigned int *)(baseAdd + (0xC)))) = lcrRegValue;
}


x86 assembly (clang, -O0):
<UARTTCRTLRBitValRestore>:
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,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x8,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x8,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x10,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%edi
mov    $0x80,%esi
call   1030 <UARTRegConfigModeEnable@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffffffbf,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
and    $0x40,%edx
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%edi
mov    $0xbf,%esi
call   1030 <UARTRegConfigModeEnable@plt>
mov    -0x4(%rbp),%eax
add    $0x8,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffffffef,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%edx
mov    -0x4(%rbp),%eax
add    $0x8,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
mov    -0x10(%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):
<UARTTCRTLRBitValRestore>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r15d
mov    %edi,%ebx
mov    $0xbf,%esi
call   1030 <UARTRegConfigModeEnable@plt>
mov    %eax,%r14d
lea    0x8(%rbx),%ebp
mov    0x0(%rbp),%r12d
and    $0x10,%r12d
orl    $0x10,0x0(%rbp)
mov    %ebx,%edi
mov    $0x80,%esi
call   1030 <UARTRegConfigModeEnable@plt>
lea    0x10(%rbx),%eax
andl   $0xffffffbf,(%rax)
and    $0x40,%r15d
or     %r15d,(%rax)
mov    %ebx,%edi
mov    $0xbf,%esi
call   1030 <UARTRegConfigModeEnable@plt>
andl   $0xffffffef,0x0(%rbp)
or     %r12d,0x0(%rbp)
add    $0xc,%ebx
mov    %r14d,(%rbx)
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @UARTTCRTLRBitValRestore(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* %6
%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* %5
%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 = call i32 @UARTRegConfigModeEnable(i32 %21, i32 128)
%23 = load i32, i32* %3
%24 = add i32 %23, 16
%25 = zext i32 %24 to i64
%26 = inttoptr i64 %25 to i32*
%27 = load volatile i32, i32* %26
%28 = and i32 %27, -65
store volatile i32 %28, i32* %26
%29 = load i32, i32* %4
%30 = and i32 %29, 64
%31 = load i32, i32* %3
%32 = add i32 %31, 16
%33 = zext i32 %32 to i64
%34 = inttoptr i64 %33 to i32*
%35 = load volatile i32, i32* %34
%36 = or i32 %35, %30
store volatile i32 %36, i32* %34
%37 = load i32, i32* %3
%38 = call i32 @UARTRegConfigModeEnable(i32 %37, i32 191)
%39 = load i32, i32* %3
%40 = add i32 %39, 8
%41 = zext i32 %40 to i64
%42 = inttoptr i64 %41 to i32*
%43 = load volatile i32, i32* %42
%44 = and i32 %43, -17
store volatile i32 %44, i32* %42
%45 = load i32, i32* %5
%46 = load i32, i32* %3
%47 = add i32 %46, 8
%48 = zext i32 %47 to i64
%49 = inttoptr i64 %48 to i32*
%50 = load volatile i32, i32* %49
%51 = or i32 %50, %45
store volatile i32 %51, i32* %49
%52 = load i32, i32* %6
%53 = load i32, i32* %3
%54 = add i32 %53, 12
%55 = zext i32 %54 to i64
%56 = inttoptr i64 %55 to i32*
store volatile i32 %52, i32* %56
ret void
}

LLVM IR (-O2):
define void @UARTTCRTLRBitValRestore(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 = tail call i32 @UARTRegConfigModeEnable(i32 %0, i32 128)
%12 = add i32 %0, 16
%13 = zext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
%15 = load volatile i32, i32* %14
%16 = and i32 %15, -65
store volatile i32 %16, i32* %14
%17 = and i32 %1, 64
%18 = load volatile i32, i32* %14
%19 = or i32 %18, %17
store volatile i32 %19, i32* %14
%20 = tail call i32 @UARTRegConfigModeEnable(i32 %0, i32 191)
%21 = load volatile i32, i32* %6
%22 = and i32 %21, -17
store volatile i32 %22, i32* %6
%23 = load volatile i32, i32* %6
%24 = or i32 %23, %8
store volatile i32 %24, i32* %6
%25 = add i32 %0, 12
%26 = zext i32 %25 to i64
%27 = inttoptr i64 %26 to i32*
store volatile i32 %3, i32* %27
ret void
}