#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 */

/* Variables and functions */
int /*<<< orphan*/ CP15AuxControlFeatureEnable(int);
int /*<<< orphan*/ CP15DCacheEnable();
int /*<<< orphan*/ CP15DCacheFlush();
int /*<<< orphan*/ CP15ICacheEnable();
int /*<<< orphan*/ CP15ICacheFlush();
int CP15MainIdPrimPartNumGet();
void CacheEnable(unsigned int enFlag) {
  if (enFlag & (0x01)) {
    CP15ICacheFlush();
    CP15ICacheEnable();
  }
  if (enFlag & (0x02)) {
    if ((0xC08) == CP15MainIdPrimPartNumGet()) {
      CP15AuxControlFeatureEnable((0x02));
    }
    CP15DCacheFlush();
    CP15DCacheEnable();
  }
}


x86 assembly (clang, -O0):
<CacheEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1188 <CacheEnable+0x28>
mov    $0x0,%al
call   1030 <CP15ICacheFlush@plt>
mov    $0x0,%al
call   1070 <CP15ICacheEnable@plt>
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     11c5 <CacheEnable+0x65>
mov    $0x0,%al
call   1060 <CP15MainIdPrimPartNumGet@plt>
mov    %eax,%ecx
mov    $0xc08,%eax
cmp    %ecx,%eax
jne    11b7 <CacheEnable+0x57>
mov    $0x2,%edi
call   1050 <CP15AuxControlFeatureEnable@plt>
mov    $0x0,%al
call   1080 <CP15DCacheFlush@plt>
mov    $0x0,%al
call   1040 <CP15DCacheEnable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CacheEnable>:
push   %rbx
mov    %edi,%ebx
test   $0x1,%bl
je     1176 <CacheEnable+0x16>
xor    %eax,%eax
call   1030 <CP15ICacheFlush@plt>
xor    %eax,%eax
call   1070 <CP15ICacheEnable@plt>
test   $0x2,%bl
jne    117d <CacheEnable+0x1d>
pop    %rbx
ret
xor    %eax,%eax
call   1060 <CP15MainIdPrimPartNumGet@plt>
cmp    $0xc08,%eax
jne    1195 <CacheEnable+0x35>
mov    $0x2,%edi
call   1050 <CP15AuxControlFeatureEnable@plt>
xor    %eax,%eax
call   1080 <CP15DCacheFlush@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <CP15DCacheEnable@plt>

LLVM IR (-O0):
define void @CacheEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 (...) @CP15ICacheFlush()
%8 = call i32 (...) @CP15ICacheEnable()
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
%11 = and i32 %10, 2
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %9
%14 = call i32 (...) @CP15MainIdPrimPartNumGet()
%15 = icmp eq i32 3080, %14
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 @CP15AuxControlFeatureEnable(i32 2)
br label %18
18: ; preds = %16, %13
%19 = call i32 (...) @CP15DCacheFlush()
%20 = call i32 (...) @CP15DCacheEnable()
br label %21
21: ; preds = %18, %9
ret void
}

LLVM IR (-O2):
define void @CacheEnable(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 (...) @CP15ICacheFlush()
%6 = tail call i32 (...) @CP15ICacheEnable()
br label %7
7: ; preds = %4, %1
%8 = and i32 %0, 2
%9 = icmp eq i32 %8, 0
br i1 %9, label %18, label %10
10: ; preds = %7
%11 = tail call i32 (...) @CP15MainIdPrimPartNumGet()
%12 = icmp eq i32 %11, 3080
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 @CP15AuxControlFeatureEnable(i32 2)
br label %15
15: ; preds = %13, %10
%16 = tail call i32 (...) @CP15DCacheFlush()
%17 = tail call i32 (...) @CP15DCacheEnable()
br label %18
18: ; preds = %15, %7
ret void
}