#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 /*<<< orphan*/);
int /*<<< orphan*/ _UARTBaseValid(int);
void UARTDisable(uint32_t ui32Base) {
  ASSERT(_UARTBaseValid(ui32Base));
  while ((*((volatile uint32_t *)(ui32Base + 0x00000018))) & 0x00000008) {
  }
  (*((volatile uint32_t *)(ui32Base + 0x0000002C))) &= ~(0x00000010);
  (*((volatile uint32_t *)(ui32Base + 0x00000030))) &=
      ~(0x00000001 | 0x00000100 | 0x00000200);
}


x86 assembly (clang, -O0):
<UARTDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x18,%eax
cltq
mov    (%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1155 <UARTDisable+0x35>
jmp    113a <UARTDisable+0x1a>
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    (%rax),%ecx
and    $0xffffffef,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
mov    (%rax),%ecx
and    $0xfffffcfe,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTDisable>:
push   %rbx
mov    %edi,%ebx
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
movslq %ebx,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
testl  $0x8,0x18(%rax)
jne    1140 <UARTDisable+0x20>
andl   $0xffffffef,0x2c(%rax)
andl   $0xfffffcfe,0x30(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @UARTDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_UARTBaseValid(i32 %3)
%5 = call i32 @ASSERT(i32 %4)
br label %6
6: ; preds = %14, %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 24
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, 8
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %6
br label %6
15: ; preds = %6
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 44
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
%20 = load volatile i32, i32* %19
%21 = and i32 %20, -17
store volatile i32 %21, i32* %19
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 48
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to i32*
%26 = load volatile i32, i32* %25
%27 = and i32 %26, -770
store volatile i32 %27, i32* %25
ret void
}

LLVM IR (-O2):
define void @UARTDisable(i32 %0) {
%2 = tail call i32 @_UARTBaseValid(i32 %0)
%3 = tail call i32 @ASSERT(i32 %2)
%4 = add nsw i32 %0, 24
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
br label %7
7: ; preds = %7, %1
%8 = load volatile i32, i32* %6
%9 = and i32 %8, 8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %7
11: ; preds = %7
%12 = add nsw i32 %0, 44
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
%15 = load volatile i32, i32* %14
%16 = and i32 %15, -17
store volatile i32 %16, i32* %14
%17 = add nsw i32 %0, 48
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
%20 = load volatile i32, i32* %19
%21 = and i32 %20, -770
store volatile i32 %21, i32* %19
ret void
}