#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*/ CP15AuxControlFeatureDisable(int);
int /*<<< orphan*/ CP15DCacheDisable();
int /*<<< orphan*/ CP15ICacheDisable();
int /*<<< orphan*/ CP15ICacheFlush();
int CP15MainIdPrimPartNumGet();
void CacheDisable(unsigned int disFlag) {
  if (disFlag & (0x01)) {
    CP15ICacheDisable();
    CP15ICacheFlush();
  }
  if (disFlag & (0x02)) {
    CP15DCacheDisable();
    if ((0xC08) == CP15MainIdPrimPartNumGet()) {
      CP15AuxControlFeatureDisable((0x02));
    }
  }
}


x86 assembly (clang, -O0):
<CacheDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1178 <CacheDisable+0x28>
mov    $0x0,%al
call   1060 <CP15ICacheDisable@plt>
mov    $0x0,%al
call   1030 <CP15ICacheFlush@plt>
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     11b3 <CacheDisable+0x63>
mov    $0x0,%al
call   1040 <CP15DCacheDisable@plt>
mov    $0x0,%al
call   1050 <CP15MainIdPrimPartNumGet@plt>
mov    %eax,%ecx
mov    $0xc08,%eax
cmp    %ecx,%eax
jne    11ae <CacheDisable+0x5e>
mov    $0x2,%edi
call   1070 <CP15AuxControlFeatureDisable@plt>
jmp    11b3 <CacheDisable+0x63>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CacheDisable>:
push   %rbx
mov    %edi,%ebx
test   $0x1,%bl
je     1166 <CacheDisable+0x16>
xor    %eax,%eax
call   1060 <CP15ICacheDisable@plt>
xor    %eax,%eax
call   1030 <CP15ICacheFlush@plt>
test   $0x2,%bl
je     118b <CacheDisable+0x3b>
xor    %eax,%eax
call   1040 <CP15DCacheDisable@plt>
xor    %eax,%eax
call   1050 <CP15MainIdPrimPartNumGet@plt>
cmp    $0xc08,%eax
jne    118b <CacheDisable+0x3b>
mov    $0x2,%edi
pop    %rbx
jmp    1070 <CP15AuxControlFeatureDisable@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @CacheDisable(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 (...) @CP15ICacheDisable()
%8 = call i32 (...) @CP15ICacheFlush()
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 %20
13: ; preds = %9
%14 = call i32 (...) @CP15DCacheDisable()
%15 = call i32 (...) @CP15MainIdPrimPartNumGet()
%16 = icmp eq i32 3080, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 @CP15AuxControlFeatureDisable(i32 2)
br label %19
19: ; preds = %17, %13
br label %20
20: ; preds = %19, %9
ret void
}

LLVM IR (-O2):
define void @CacheDisable(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 (...) @CP15ICacheDisable()
%6 = tail call i32 (...) @CP15ICacheFlush()
br label %7
7: ; preds = %4, %1
%8 = and i32 %0, 2
%9 = icmp eq i32 %8, 0
br i1 %9, label %16, label %10
10: ; preds = %7
%11 = tail call i32 (...) @CP15DCacheDisable()
%12 = tail call i32 (...) @CP15MainIdPrimPartNumGet()
%13 = icmp eq i32 %12, 3080
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = tail call i32 @CP15AuxControlFeatureDisable(i32 2)
br label %16
16: ; preds = %10, %14, %7
ret void
}