#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 DESIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ASSERT(ui32Base == 0x44038000);
  ASSERT((ui32IntFlags & 0x00000001) || (ui32IntFlags & 0x00000002) ||
         (ui32IntFlags & 0x00000004) || (ui32IntFlags & 0x00010000) ||
         (ui32IntFlags & 0x00020000) || (ui32IntFlags & 0x00040000));
  (*((volatile uint32_t *)(ui32Base + 0xFFFF8030))) &=
      ~((ui32IntFlags & 0x00070000) >> 16);
  (*((volatile uint32_t *)(ui32Base + 0x00000040))) &=
      ~(ui32IntFlags & 0x0000ffff);
}


x86 assembly (clang, -O0):
<DESIntDisable>:
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    $0x1,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    11ad <DESIntDisable+0x9d>
mov    -0x8(%rbp),%ecx
and    $0x2,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    11ad <DESIntDisable+0x9d>
mov    -0x8(%rbp),%ecx
and    $0x4,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    11ad <DESIntDisable+0x9d>
mov    -0x8(%rbp),%ecx
and    $0x10000,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    11ad <DESIntDisable+0x9d>
mov    -0x8(%rbp),%ecx
and    $0x20000,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    11ad <DESIntDisable+0x9d>
mov    -0x8(%rbp),%eax
and    $0x40000,%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
and    $0x70000,%edx
sar    $0x10,%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0xffff8030,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
and    $0xffff,%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0x40,%eax
cltq
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DESIntDisable>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %edi,%r14d
mov    %esi,%ebx
not    %ebx
xor    %edi,%edi
cmp    $0x44038000,%r14d
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
test   $0x70007,%ebp
setne  %dil
call   1030 <ASSERT@plt>
shr    $0x10,%ebp
not    %ebp
or     $0xfffffff8,%ebp
lea    -0x7fd0(%r14),%eax
and    %ebp,(%rax)
or     $0xffff0000,%ebx
movslq %r14d,%rax
and    %ebx,0x40(%rax)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @DESIntDisable(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, 1
%11 = icmp ne i32 %10, 0
br i1 %11, label %32, label %12
12: ; preds = %2
%13 = load i32, i32* %4
%14 = and i32 %13, 2
%15 = icmp ne i32 %14, 0
br i1 %15, label %32, label %16
16: ; preds = %12
%17 = load i32, i32* %4
%18 = and i32 %17, 4
%19 = icmp ne i32 %18, 0
br i1 %19, label %32, label %20
20: ; preds = %16
%21 = load i32, i32* %4
%22 = and i32 %21, 65536
%23 = icmp ne i32 %22, 0
br i1 %23, label %32, label %24
24: ; preds = %20
%25 = load i32, i32* %4
%26 = and i32 %25, 131072
%27 = icmp ne i32 %26, 0
br i1 %27, label %32, label %28
28: ; preds = %24
%29 = load i32, i32* %4
%30 = and i32 %29, 262144
%31 = icmp ne i32 %30, 0
br label %32
32: ; preds = %28, %24, %20, %16, %12, %2
%33 = phi i1 [ true, %24 ], [ true, %20 ], [ true, %16 ], [ true, %12 ], [ true, %2 ], [ %31, %28 ]
%34 = zext i1 %33 to i32
%35 = call i32 @ASSERT(i32 %34)
%36 = load i32, i32* %4
%37 = and i32 %36, 458752
%38 = ashr i32 %37, 16
%39 = xor i32 %38, -1
%40 = load i32, i32* %3
%41 = add i32 %40, -32720
%42 = zext i32 %41 to i64
%43 = inttoptr i64 %42 to i32*
%44 = load volatile i32, i32* %43
%45 = and i32 %44, %39
store volatile i32 %45, i32* %43
%46 = load i32, i32* %4
%47 = and i32 %46, 65535
%48 = xor i32 %47, -1
%49 = load i32, i32* %3
%50 = add nsw i32 %49, 64
%51 = sext i32 %50 to i64
%52 = inttoptr i64 %51 to i32*
%53 = load volatile i32, i32* %52
%54 = and i32 %53, %48
store volatile i32 %54, i32* %52
ret void
}

LLVM IR (-O2):
define void @DESIntDisable(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, 458759
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @ASSERT(i32 %8)
%10 = lshr i32 %1, 16
%11 = and i32 %10, 7
%12 = xor i32 %11, -1
%13 = add i32 %0, -32720
%14 = zext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = and i32 %16, %12
store volatile i32 %17, i32* %15
%18 = and i32 %1, 65535
%19 = xor i32 %18, -1
%20 = add nsw i32 %0, 64
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
%23 = load volatile i32, i32* %22
%24 = and i32 %23, %19
store volatile i32 %24, i32* %22
ret void
}