#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);
void UARTModemControlClear(uint32_t ui32Base, uint32_t ui32Control) {
  uint32_t ui32Temp;
  ASSERT(ui32Base == 0x4000D000);
  ASSERT((ui32Control & ~(0x00000800 | 0x00000400)) == 0);
  ui32Temp = (*((volatile uint32_t *)(ui32Base + 0x00000030)));
  ui32Temp &= ~(ui32Control & (0x00000800 | 0x00000400));
  (*((volatile uint32_t *)(ui32Base + 0x00000030))) = ui32Temp;
}


x86 assembly (clang, -O0):
<UARTModemControlClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x4000d000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%eax
and    $0xfffff3ff,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xc00,%eax
xor    $0xffffffff,%eax
and    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTModemControlClear>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %edi,%r14d
mov    %esi,%ebx
not    %ebx
xor    %edi,%edi
cmp    $0x4000d000,%r14d
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
test   $0xfffff3ff,%ebp
sete   %dil
call   1030 <ASSERT@plt>
movslq %r14d,%rax
or     $0xfffff3ff,%ebx
and    %ebx,0x30(%rax)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @UARTModemControlClear(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 1073795072
%8 = zext i1 %7 to i32
%9 = call i32 @ASSERT(i32 %8)
%10 = load i32, i32* %4
%11 = and i32 %10, -3073
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @ASSERT(i32 %13)
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 48
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
%19 = load volatile i32, i32* %18
store i32 %19, i32* %5
%20 = load i32, i32* %4
%21 = and i32 %20, 3072
%22 = xor i32 %21, -1
%23 = load i32, i32* %5
%24 = and i32 %23, %22
store i32 %24, i32* %5
%25 = load i32, i32* %5
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 48
%28 = sext i32 %27 to i64
%29 = inttoptr i64 %28 to i32*
store volatile i32 %25, i32* %29
ret void
}

LLVM IR (-O2):
define void @UARTModemControlClear(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1073795072
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = and i32 %1, -3073
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @ASSERT(i32 %8)
%10 = add nsw i32 %0, 48
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
%14 = and i32 %1, 3072
%15 = xor i32 %14, -1
%16 = and i32 %13, %15
store volatile i32 %16, i32* %12
ret void
}