#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*/ cache_clear_all();
int /*<<< orphan*/ cache_clear_hash(char *);
void cache_clear_cache(int argc, char *argv[]) {
  int i;
  if (argc == 0) {
    cache_clear_all();
  } else {
    for (i = 0; i < argc; ++i) {
      cache_clear_hash(argv[i]);
    }
  }
}


x86 assembly (clang, -O0):
<cache_clear_cache>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1145 <cache_clear_cache+0x25>
mov    $0x0,%al
call   1040 <cache_clear_all@plt>
jmp    117c <cache_clear_cache+0x5c>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1177 <cache_clear_cache+0x57>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <cache_clear_hash@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114c <cache_clear_cache+0x2c>
jmp    117c <cache_clear_cache+0x5c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cache_clear_cache>:
test   %edi,%edi
je     1158 <cache_clear_cache+0x38>
push   %r15
push   %r14
push   %rbx
jle    1152 <cache_clear_cache+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <cache_clear_hash@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <cache_clear_cache+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret
xor    %eax,%eax
jmp    1040 <cache_clear_all@plt>

LLVM IR (-O0):
define void @cache_clear_cache(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @cache_clear_all()
br label %26
10: ; preds = %2
store i32 0, i32* %5
br label %11
11: ; preds = %22, %10
%12 = load i32, i32* %5
%13 = load i32, i32* %3
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %25
15: ; preds = %11
%16 = load i8**, i8*** %4
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %16, i64 %18
%20 = load i8*, i8** %19
%21 = call i32 @cache_clear_hash(i8* %20)
br label %22
22: ; preds = %15
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %11
25: ; preds = %11
br label %26
26: ; preds = %25, %8
ret void
}

LLVM IR (-O2):
define void @cache_clear_cache(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %17
6: ; preds = %4
%7 = zext i32 %0 to i64
br label %10
8: ; preds = %2
%9 = tail call i32 (...) @cache_clear_all()
br label %17
10: ; preds = %6, %10
%11 = phi i64 [ 0, %6 ], [ %15, %10 ]
%12 = getelementptr inbounds i8*, i8** %1, i64 %11
%13 = load i8*, i8** %12
%14 = tail call i32 @cache_clear_hash(i8* %13)
%15 = add nuw nsw i64 %11, 1
%16 = icmp eq i64 %15, %7
br i1 %16, label %17, label %10
17: ; preds = %10, %4, %8
ret void
}