#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*/ l1_cache_find_range(unsigned int, unsigned int,
                                       unsigned int *, unsigned int *);
int /*<<< orphan*/ l1_cache_operate_on_line(unsigned int, unsigned int);
void l1_cache_operate_on_line_range(unsigned oper_offset, unsigned addr,
                                    unsigned size) {
  const unsigned inc_addr = (((1 << (4)) - 1) + 1);
  unsigned cur_addr;
  unsigned end_addr;
  if (size == 0)
    return;
  l1_cache_find_range(addr, size, &cur_addr, &end_addr);
  for (; cur_addr != end_addr; cur_addr += inc_addr)
    l1_cache_operate_on_line(oper_offset, cur_addr);
}


x86 assembly (clang, -O0):
<l1_cache_operate_on_line_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x10,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1147 <l1_cache_operate_on_line_range+0x27>
jmp    117f <l1_cache_operate_on_line_range+0x5f>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1030 <l1_cache_find_range@plt>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
je     117f <l1_cache_operate_on_line_range+0x5f>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <l1_cache_operate_on_line@plt>
mov    -0x14(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x14(%rbp)
jmp    115a <l1_cache_operate_on_line_range+0x3a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l1_cache_operate_on_line_range>:
push   %rbx
sub    $0x10,%rsp
test   %edx,%edx
je     1168 <l1_cache_operate_on_line_range+0x48>
mov    %edi,%ebx
lea    0x8(%rsp),%rax
lea    0xc(%rsp),%rcx
mov    %esi,%edi
mov    %edx,%esi
mov    %rax,%rdx
call   1030 <l1_cache_find_range@plt>
mov    0x8(%rsp),%esi
cmp    0xc(%rsp),%esi
je     1168 <l1_cache_operate_on_line_range+0x48>
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1040 <l1_cache_operate_on_line@plt>
mov    0x8(%rsp),%esi
add    $0x10,%esi
mov    %esi,0x8(%rsp)
cmp    0xc(%rsp),%esi
jne    1150 <l1_cache_operate_on_line_range+0x30>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @l1_cache_operate_on_line_range(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 16, i32* %7
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %3
br label %28
13: ; preds = %3
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @l1_cache_find_range(i32 %14, i32 %15, i32* %8, i32* %9)
br label %17
17: ; preds = %25, %13
%18 = load i32, i32* %8
%19 = load i32, i32* %9
%20 = icmp ne i32 %18, %19
br i1 %20, label %21, label %28
21: ; preds = %17
%22 = load i32, i32* %4
%23 = load i32, i32* %8
%24 = call i32 @l1_cache_operate_on_line(i32 %22, i32 %23)
br label %25
25: ; preds = %21
%26 = load i32, i32* %8
%27 = add i32 %26, 16
store i32 %27, i32* %8
br label %17
28: ; preds = %12, %17
ret void
}

LLVM IR (-O2):
define void @l1_cache_operate_on_line_range(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %4 to i8*
%7 = bitcast i32* %5 to i8*
%8 = icmp eq i32 %2, 0
br i1 %8, label %21, label %9
9: ; preds = %3
%10 = call i32 @l1_cache_find_range(i32 %1, i32 %2, i32* %4, i32* %5)
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = icmp eq i32 %11, %12
br i1 %13, label %21, label %14
14: ; preds = %9, %14
%15 = phi i32 [ %18, %14 ], [ %11, %9 ]
%16 = call i32 @l1_cache_operate_on_line(i32 %0, i32 %15)
%17 = load i32, i32* %4
%18 = add i32 %17, 16
store i32 %18, i32* %4
%19 = load i32, i32* %5
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %14
21: ; preds = %14, %9, %3
ret void
}