#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*/ hash(int);
void test() {
  int __ii0;
  int i;
  for (__ii0 = 0; __ii0 <= 10; __ii0++) {
    for (i = 4 * __ii0; i <= ((41) < (4 * __ii0 + 3) ? (41) : (4 * __ii0 + 3));
         i++) {
      {
        hash(1);
        hash(i);
      };
    }
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jg     11a8 <test+0x98>
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
shl    $0x2,%ecx
add    $0x3,%ecx
mov    $0x29,%eax
cmp    %ecx,%eax
jge    115b <test+0x4b>
mov    $0x29,%eax
mov    %eax,-0x10(%rbp)
jmp    1167 <test+0x57>
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
add    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
cmp    %ecx,%eax
jg     1195 <test+0x85>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <test+0x22>
jmp    119a <test+0x8a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <test+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %r14d,%r14d
mov    $0xffffffff,%r12d
mov    $0x29,%r15d
jmp    113e <test+0x2e>
nopl   0x0(%rax)
add    $0x1,%r14d
add    $0x4,%r12d
cmp    $0xb,%r14d
je     117a <test+0x6a>
lea    0x0(,%r14,4),%eax
lea    0x3(,%r14,4),%ebp
cmp    $0x29,%ebp
cmovae %r15d,%ebp
cmp    %ebp,%eax
ja     1130 <test+0x20>
mov    %r12d,%ebx
nopl   0x0(%rax)
add    $0x1,%ebx
mov    $0x1,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
call   1030 <hash@plt>
cmp    %ebp,%ebx
jb     1160 <test+0x50>
jmp    1130 <test+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %31, %0
%4 = load i32, i32* %1
%5 = icmp sle i32 %4, 10
br i1 %5, label %6, label %34
6: ; preds = %3
%7 = load i32, i32* %1
%8 = mul nsw i32 4, %7
store i32 %8, i32* %2
br label %9
9: ; preds = %27, %6
%10 = load i32, i32* %2
%11 = load i32, i32* %1
%12 = mul nsw i32 4, %11
%13 = add nsw i32 %12, 3
%14 = icmp slt i32 41, %13
br i1 %14, label %15, label %16
15: ; preds = %9
br label %20
16: ; preds = %9
%17 = load i32, i32* %1
%18 = mul nsw i32 4, %17
%19 = add nsw i32 %18, 3
br label %20
20: ; preds = %16, %15
%21 = phi i32 [ 41, %15 ], [ %19, %16 ]
%22 = icmp sle i32 %10, %21
br i1 %22, label %23, label %30
23: ; preds = %20
%24 = call i32 @hash(i32 1)
%25 = load i32, i32* %2
%26 = call i32 @hash(i32 %25)
br label %27
27: ; preds = %23
%28 = load i32, i32* %2
%29 = add nsw i32 %28, 1
store i32 %29, i32* %2
br label %9
30: ; preds = %20
br label %31
31: ; preds = %30
%32 = load i32, i32* %1
%33 = add nsw i32 %32, 1
store i32 %33, i32* %1
br label %3
34: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @test() {
br label %1
1: ; preds = %0, %14
%2 = phi i32 [ 0, %0 ], [ %15, %14 ]
%3 = shl nuw nsw i32 %2, 2
%4 = or i32 %3, 3
%5 = icmp ult i32 %4, 41
%6 = select i1 %5, i32 %4, i32 41
%7 = icmp ugt i32 %3, %6
br i1 %7, label %14, label %8
8: ; preds = %1, %8
%9 = phi i32 [ %12, %8 ], [ %3, %1 ]
%10 = tail call i32 @hash(i32 1)
%11 = tail call i32 @hash(i32 %9)
%12 = add nuw nsw i32 %9, 1
%13 = icmp ult i32 %9, %6
br i1 %13, label %8, label %14
14: ; preds = %8, %1
%15 = add nuw nsw i32 %2, 1
%16 = icmp eq i32 %15, 11
br i1 %16, label %17, label %1
17: ; preds = %14
ret void
}