#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 DESDMADisable(uint32_t ui32Base, uint32_t ui32Flags) {
  ASSERT(ui32Base == 0x44038000);
  ASSERT((ui32Flags & 0x00000080) || (ui32Flags & 0x00000040) ||
         (ui32Flags & 0x00000020));
  (*((volatile uint32_t *)(ui32Base + 0x00000034))) &= ~ui32Flags;
}


x86 assembly (clang, -O0):
<DESDMADisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x44038000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%ecx
and    $0x80,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    116c <DESDMADisable+0x5c>
mov    -0x8(%rbp),%ecx
and    $0x40,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    116c <DESDMADisable+0x5c>
mov    -0x8(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0x34,%eax
cltq
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DESDMADisable>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x44038000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
test   $0xe0,%bl
setne  %dil
call   1030 <ASSERT@plt>
not    %ebx
movslq %ebp,%rax
and    %ebx,0x34(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @DESDMADisable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1141080064
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = and i32 %9, 128
%11 = icmp ne i32 %10, 0
br i1 %11, label %20, label %12
12: ; preds = %2
%13 = load i32, i32* %4
%14 = and i32 %13, 64
%15 = icmp ne i32 %14, 0
br i1 %15, label %20, label %16
16: ; preds = %12
%17 = load i32, i32* %4
%18 = and i32 %17, 32
%19 = icmp ne i32 %18, 0
br label %20
20: ; preds = %16, %12, %2
%21 = phi i1 [ true, %12 ], [ true, %2 ], [ %19, %16 ]
%22 = zext i1 %21 to i32
%23 = call i32 @ASSERT(i32 %22)
%24 = load i32, i32* %4
%25 = xor i32 %24, -1
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 52
%28 = sext i32 %27 to i64
%29 = inttoptr i64 %28 to i32*
%30 = load volatile i32, i32* %29
%31 = and i32 %30, %25
store volatile i32 %31, i32* %29
ret void
}

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