#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 i, j, k;
  for (i = 3; i <= 9; i++) {
    for (j = ((1) > (i - 6) ? (1) : (i - 6));
         j <= ((3) < (i - 2) ? (3) : (i - 2)); j++) {
      if ((i + j) % 2 == 0) {
        {
          hash(1);
          hash(i);
          hash(j);
          hash(((i - j) / 2));
        };
      }
    }
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x3,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jg     1201 <test+0xf1>
mov    -0x4(%rbp),%ecx
sub    $0x6,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
jle    1149 <test+0x39>
mov    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1152 <test+0x42>
mov    -0x4(%rbp),%eax
sub    $0x6,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%ecx
sub    $0x2,%ecx
mov    $0x3,%eax
cmp    %ecx,%eax
jge    117e <test+0x6e>
mov    $0x3,%eax
mov    %eax,-0x18(%rbp)
jmp    1187 <test+0x77>
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
cmp    %ecx,%eax
jg     11ee <test+0xde>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11db <test+0xcb>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <hash@plt>
jmp    11e0 <test+0xd0>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1158 <test+0x48>
jmp    11f3 <test+0xe3>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <test+0xf>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x3,%r15d
movl   $0x9,0x4(%rsp)
mov    $0xfffffffd,%r12d
jmp    1153 <test+0x43>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15d
addl   $0x1,0x4(%rsp)
add    $0x1,%r12d
cmp    $0xa,%r15d
je     11d2 <test+0xc2>
cmp    $0x8,%r15d
mov    $0x7,%ebx
cmovae %r15d,%ebx
lea    -0x6(%rbx),%eax
cmp    $0x5,%r15d
mov    $0x5,%r13d
cmovb  %r15d,%r13d
add    $0xfffffffe,%r13d
cmp    %r13d,%eax
jg     1140 <test+0x30>
mov    0x4(%rsp),%r14d
sub    %ebx,%r14d
jmp    119c <test+0x8c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%ebx
add    $0xffffffff,%r14d
cmp    %r13d,%ebp
jae    1140 <test+0x30>
lea    -0x6(%rbx),%ebp
lea    (%r12,%rbx,1),%eax
test   $0x1,%al
jne    1190 <test+0x80>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    %r15d,%edi
call   1030 <hash@plt>
mov    %ebp,%edi
call   1030 <hash@plt>
mov    %r14d,%edi
shr    $0x1f,%edi
add    %r14d,%edi
sar    %edi
call   1030 <hash@plt>
jmp    1190 <test+0x80>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 3, i32* %1
br label %4
4: ; preds = %51, %0
%5 = load i32, i32* %1
%6 = icmp sle i32 %5, 9
br i1 %6, label %7, label %54
7: ; preds = %4
%8 = load i32, i32* %1
%9 = sub nsw i32 %8, 6
%10 = icmp sgt i32 1, %9
br i1 %10, label %11, label %12
11: ; preds = %7
br label %15
12: ; preds = %7
%13 = load i32, i32* %1
%14 = sub nsw i32 %13, 6
br label %15
15: ; preds = %12, %11
%16 = phi i32 [ 1, %11 ], [ %14, %12 ]
store i32 %16, i32* %2
br label %17
17: ; preds = %47, %15
%18 = load i32, i32* %2
%19 = load i32, i32* %1
%20 = sub nsw i32 %19, 2
%21 = icmp slt i32 3, %20
br i1 %21, label %22, label %23
22: ; preds = %17
br label %26
23: ; preds = %17
%24 = load i32, i32* %1
%25 = sub nsw i32 %24, 2
br label %26
26: ; preds = %23, %22
%27 = phi i32 [ 3, %22 ], [ %25, %23 ]
%28 = icmp sle i32 %18, %27
br i1 %28, label %29, label %50
29: ; preds = %26
%30 = load i32, i32* %1
%31 = load i32, i32* %2
%32 = add nsw i32 %30, %31
%33 = srem i32 %32, 2
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %46
35: ; preds = %29
%36 = call i32 @hash(i32 1)
%37 = load i32, i32* %1
%38 = call i32 @hash(i32 %37)
%39 = load i32, i32* %2
%40 = call i32 @hash(i32 %39)
%41 = load i32, i32* %1
%42 = load i32, i32* %2
%43 = sub nsw i32 %41, %42
%44 = sdiv i32 %43, 2
%45 = call i32 @hash(i32 %44)
br label %46
46: ; preds = %35, %29
br label %47
47: ; preds = %46
%48 = load i32, i32* %2
%49 = add nsw i32 %48, 1
store i32 %49, i32* %2
br label %17
50: ; preds = %26
br label %51
51: ; preds = %50
%52 = load i32, i32* %1
%53 = add nsw i32 %52, 1
store i32 %53, i32* %1
br label %4
54: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @test() {
br label %1
1: ; preds = %0, %25
%2 = phi i32 [ 3, %0 ], [ %26, %25 ]
%3 = icmp ugt i32 %2, 7
%4 = select i1 %3, i32 %2, i32 7
%5 = add nsw i32 %4, -6
%6 = icmp ult i32 %2, 5
%7 = select i1 %6, i32 %2, i32 5
%8 = add nsw i32 %7, -2
%9 = icmp sgt i32 %5, %8
br i1 %9, label %25, label %10
10: ; preds = %1, %22
%11 = phi i32 [ %23, %22 ], [ %5, %1 ]
%12 = add nsw i32 %11, %2
%13 = and i32 %12, 1
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %10
%16 = tail call i32 @hash(i32 1)
%17 = tail call i32 @hash(i32 %2)
%18 = tail call i32 @hash(i32 %11)
%19 = sub nsw i32 %2, %11
%20 = sdiv i32 %19, 2
%21 = tail call i32 @hash(i32 %20)
br label %22
22: ; preds = %10, %15
%23 = add nsw i32 %11, 1
%24 = icmp ult i32 %11, %8
br i1 %24, label %10, label %25
25: ; preds = %22, %1
%26 = add nuw nsw i32 %2, 1
%27 = icmp eq i32 %26, 10
br i1 %27, label %28, label %1
28: ; preds = %25
ret void
}