#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*/ blackfin_dcache_flush_range(unsigned long, unsigned long);
int /*<<< orphan*/ blackfin_icache_flush_range(unsigned long, unsigned long);
scalar_t__ dcache_status();
scalar_t__ icache_status();
void flush_cache(unsigned long dummy1, unsigned long dummy2) {
  if (icache_status()) {
    blackfin_icache_flush_range(dummy1, dummy1 + dummy2);
  }
  if (dcache_status()) {
    blackfin_dcache_flush_range(dummy1, dummy1 + dummy2);
  }
  return;
}


x86 assembly (clang, -O0):
<flush_cache>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <icache_status@plt>
cmp    $0x0,%rax
je     1172 <flush_cache+0x32>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    -0x10(%rbp),%rsi
call   1030 <blackfin_icache_flush_range@plt>
mov    $0x0,%al
call   1050 <dcache_status@plt>
cmp    $0x0,%rax
je     1194 <flush_cache+0x54>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    -0x10(%rbp),%rsi
call   1040 <blackfin_dcache_flush_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_cache>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <icache_status@plt>
test   %rax,%rax
je     1162 <flush_cache+0x22>
lea    (%r14,%rbx,1),%rsi
mov    %rbx,%rdi
call   1030 <blackfin_icache_flush_range@plt>
xor    %eax,%eax
call   1050 <dcache_status@plt>
test   %rax,%rax
je     1183 <flush_cache+0x43>
add    %rbx,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <blackfin_dcache_flush_range@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @flush_cache(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i64 (...) @icache_status()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i64, i64* %3
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = add i64 %9, %10
%12 = call i32 @blackfin_icache_flush_range(i64 %8, i64 %11)
br label %13
13: ; preds = %7, %2
%14 = call i64 (...) @dcache_status()
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %13
%17 = load i64, i64* %3
%18 = load i64, i64* %3
%19 = load i64, i64* %4
%20 = add i64 %18, %19
%21 = call i32 @blackfin_dcache_flush_range(i64 %17, i64 %20)
br label %22
22: ; preds = %16, %13
ret void
}

LLVM IR (-O2):
define void @flush_cache(i64 %0, i64 %1) {
%3 = tail call i64 (...) @icache_status()
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = add i64 %1, %0
%7 = tail call i32 @blackfin_icache_flush_range(i64 %0, i64 %6)
br label %8
8: ; preds = %5, %2
%9 = tail call i64 (...) @dcache_status()
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = add i64 %1, %0
%13 = tail call i32 @blackfin_dcache_flush_range(i64 %0, i64 %12)
br label %14
14: ; preds = %11, %8
ret void
}