#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 CP15MainIdPrimPartNumGet();
void CacheDisable(unsigned int disFlag) {
  if (disFlag & (0x01)) {
    CP15ICacheDisable();
  }
  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     1161 <CacheDisable+0x21>
mov    $0x0,%al
call   1050 <CP15ICacheDisable@plt>
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     119c <CacheDisable+0x5c>
mov    $0x0,%al
call   1030 <CP15DCacheDisable@plt>
mov    $0x0,%al
call   1040 <CP15MainIdPrimPartNumGet@plt>
mov    %eax,%ecx
mov    $0xc08,%eax
cmp    %ecx,%eax
jne    1197 <CacheDisable+0x57>
mov    $0x2,%edi
call   1060 <CP15AuxControlFeatureDisable@plt>
jmp    119c <CacheDisable+0x5c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CacheDisable>:
push   %rbx
mov    %edi,%ebx
test   $0x1,%bl
je     114f <CacheDisable+0xf>
xor    %eax,%eax
call   1050 <CP15ICacheDisable@plt>
test   $0x2,%bl
je     1174 <CacheDisable+0x34>
xor    %eax,%eax
call   1030 <CP15DCacheDisable@plt>
xor    %eax,%eax
call   1040 <CP15MainIdPrimPartNumGet@plt>
cmp    $0xc08,%eax
jne    1174 <CacheDisable+0x34>
mov    $0x2,%edi
pop    %rbx
jmp    1060 <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 %8
6: ; preds = %1
%7 = call i32 (...) @CP15ICacheDisable()
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
%10 = and i32 %9, 2
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = call i32 (...) @CP15DCacheDisable()
%14 = call i32 (...) @CP15MainIdPrimPartNumGet()
%15 = icmp eq i32 3080, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = call i32 @CP15AuxControlFeatureDisable(i32 2)
br label %18
18: ; preds = %16, %12
br label %19
19: ; preds = %18, %8
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 %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @CP15ICacheDisable()
br label %6
6: ; preds = %4, %1
%7 = and i32 %0, 2
%8 = icmp eq i32 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %6
%10 = tail call i32 (...) @CP15DCacheDisable()
%11 = tail call i32 (...) @CP15MainIdPrimPartNumGet()
%12 = icmp eq i32 %11, 3080
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = tail call i32 @CP15AuxControlFeatureDisable(i32 2)
br label %15
15: ; preds = %9, %13, %6
ret void
}