#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 AESIntClear(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ASSERT(ui32Base == 0x44036000);
  ASSERT((ui32IntFlags == 0x00010000) || (ui32IntFlags == 0x00080000) ||
         (ui32IntFlags == 0x00020000) || (ui32IntFlags == 0x00040000));
  (*((volatile uint32_t *)(ui32Base + 0xFFFFA02C))) =
      (((ui32IntFlags & 0x00010000) >> 16) |
       ((ui32IntFlags & 0x00060000) >> 15) |
       ((ui32IntFlags & 0x00080000) >> 18));
}


x86 assembly (clang, -O0):
<AESIntClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x44036000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    $0x1,%al
cmpl   $0x10000,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1175 <AESIntClear+0x65>
mov    $0x1,%al
cmpl   $0x80000,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1175 <AESIntClear+0x65>
mov    $0x1,%al
cmpl   $0x20000,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1175 <AESIntClear+0x65>
cmpl   $0x40000,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%ecx
and    $0x10000,%ecx
sar    $0x10,%ecx
mov    -0x8(%rbp),%eax
and    $0x60000,%eax
sar    $0xf,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%eax
and    $0x80000,%eax
sar    $0x12,%eax
or     %eax,%ecx
mov    -0x4(%rbp),%eax
add    $0xffffa02c,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AESIntClear>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%r14d
xor    %edi,%edi
cmp    $0x44036000,%r14d
sete   %dil
call   1030 <ASSERT@plt>
mov    $0x1,%edi
cmp    $0x10000,%ebx
je     1154 <AESIntClear+0x44>
cmp    $0x20000,%ebx
je     1154 <AESIntClear+0x44>
cmp    $0x80000,%ebx
je     1154 <AESIntClear+0x44>
xor    %edi,%edi
cmp    $0x40000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
mov    %ebx,%eax
shr    $0x10,%eax
and    $0x1,%eax
mov    %ebx,%ecx
shr    $0xf,%ecx
and    $0xc,%ecx
or     %eax,%ecx
shr    $0x12,%ebx
and    $0x2,%ebx
or     %ecx,%ebx
add    $0xffffa02c,%r14d
mov    %ebx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @AESIntClear(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, 1141071872
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 65536
br i1 %10, label %20, label %11
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 524288
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 131072
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 262144
br label %20
20: ; preds = %17, %14, %11, %2
%21 = phi i1 [ true, %14 ], [ true, %11 ], [ true, %2 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
%23 = call i32 @ASSERT(i32 %22)
%24 = load i32, i32* %4
%25 = and i32 %24, 65536
%26 = ashr i32 %25, 16
%27 = load i32, i32* %4
%28 = and i32 %27, 393216
%29 = ashr i32 %28, 15
%30 = or i32 %26, %29
%31 = load i32, i32* %4
%32 = and i32 %31, 524288
%33 = ashr i32 %32, 18
%34 = or i32 %30, %33
%35 = load i32, i32* %3
%36 = add i32 %35, -24532
%37 = zext i32 %36 to i64
%38 = inttoptr i64 %37 to i32*
store volatile i32 %34, i32* %38
ret void
}

LLVM IR (-O2):
define void @AESIntClear(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1141071872
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
switch i32 %1, label %6 [
i32 524288, label %9
i32 131072, label %9
i32 65536, label %9
]
6: ; preds = %2
%7 = icmp eq i32 %1, 262144
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %2, %2, %2, %6
%10 = phi i32 [ 1, %2 ], [ %8, %6 ], [ 1, %2 ], [ 1, %2 ]
%11 = tail call i32 @ASSERT(i32 %10)
%12 = lshr i32 %1, 16
%13 = and i32 %12, 1
%14 = lshr i32 %1, 15
%15 = and i32 %14, 12
%16 = or i32 %13, %15
%17 = lshr i32 %1, 18
%18 = and i32 %17, 2
%19 = or i32 %16, %18
%20 = add i32 %0, -24532
%21 = zext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
store volatile i32 %19, i32* %22
ret void
}