#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*/ UARTConfigSet(unsigned long, unsigned long, unsigned long);
void xUARTIrDAConfig(unsigned long ulBase, unsigned long ulBaud,
                     unsigned long ulConfig, unsigned long ulMode) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000014))) &=
      ~(0x00000002 | 0x00000004);
  UARTConfigSet(ulBase, ulBaud, ulConfig);
  (*((volatile unsigned long *)(ulBase + 0x00000014))) &= ~0x00000004;
  if ((ulMode & 0x80000000) == 0x80000000) {
    (*((volatile unsigned long *)(ulBase + 0x00000014))) |= (0x00000004);
  }
}


x86 assembly (clang, -O0):
<xUARTIrDAConfig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%rcx
and    $0xfffffffffffffff9,%rcx
mov    %rcx,0x14(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <UARTConfigSet@plt>
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%rcx
and    $0xfffffffffffffffb,%rcx
mov    %rcx,0x14(%rax)
movabs $0x80000000,%rax
and    -0x20(%rbp),%rax
mov    $0x80000000,%ecx
cmp    %rcx,%rax
jne    1185 <xUARTIrDAConfig+0x75>
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%rcx
or     $0x4,%rcx
mov    %rcx,0x14(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xUARTIrDAConfig>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdi,%rbx
andq   $0xfffffffffffffff9,0x14(%rdi)
call   1030 <UARTConfigSet@plt>
andq   $0xfffffffffffffffb,0x14(%rbx)
test   $0x80000000,%r14d
je     1137 <xUARTIrDAConfig+0x27>
orq    $0x4,0x14(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @xUARTIrDAConfig(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = add i64 %9, 20
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = and i64 %12, -7
store volatile i64 %13, i64* %11
%14 = load i64, i64* %5
%15 = load i64, i64* %6
%16 = load i64, i64* %7
%17 = call i32 @UARTConfigSet(i64 %14, i64 %15, i64 %16)
%18 = load i64, i64* %5
%19 = add i64 %18, 20
%20 = inttoptr i64 %19 to i64*
%21 = load volatile i64, i64* %20
%22 = and i64 %21, -5
store volatile i64 %22, i64* %20
%23 = load i64, i64* %8
%24 = and i64 %23, 2147483648
%25 = icmp eq i64 %24, 2147483648
br i1 %25, label %26, label %32
26: ; preds = %4
%27 = load i64, i64* %5
%28 = add i64 %27, 20
%29 = inttoptr i64 %28 to i64*
%30 = load volatile i64, i64* %29
%31 = or i64 %30, 4
store volatile i64 %31, i64* %29
br label %32
32: ; preds = %26, %4
ret void
}

LLVM IR (-O2):
define void @xUARTIrDAConfig(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = add i64 %0, 20
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = and i64 %7, -7
store volatile i64 %8, i64* %6
%9 = tail call i32 @UARTConfigSet(i64 %0, i64 %1, i64 %2)
%10 = load volatile i64, i64* %6
%11 = and i64 %10, -5
store volatile i64 %11, i64* %6
%12 = and i64 %3, 2147483648
%13 = icmp eq i64 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %4
%15 = load volatile i64, i64* %6
%16 = or i64 %15, 4
store volatile i64 %16, i64* %6
br label %17
17: ; preds = %14, %4
ret void
}