#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 j, a, b;
  for (j = 2; j <= 8; j++) {
    if (j % 2 == 0) {
      {
        hash(1);
        hash(j);
        hash(j / 2);
        hash(j / 2);
      };
      {
        hash(2);
        hash(j);
        hash(j / 2);
        hash(j / 2);
      };
    }
  }
  {
    hash(2);
    hash(10);
    hash(5);
    hash(5);
  };
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jg     11bc <test+0xac>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11a9 <test+0x99>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <hash@plt>
jmp    11ae <test+0x9e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <test+0xf>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    $0xa,%edi
call   1030 <hash@plt>
mov    $0x5,%edi
call   1030 <hash@plt>
mov    $0x5,%edi
call   1030 <hash@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %rbx
push   %rax
mov    $0x2,%ebx
jmp    1128 <test+0x18>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0x9,%ebx
je     1171 <test+0x61>
test   $0x1,%bl
jne    1120 <test+0x10>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
call   1030 <hash@plt>
mov    %ebx,%ebp
shr    %ebp
mov    %ebp,%edi
call   1030 <hash@plt>
mov    %ebp,%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
call   1030 <hash@plt>
mov    %ebp,%edi
call   1030 <hash@plt>
mov    %ebp,%edi
call   1030 <hash@plt>
jmp    1120 <test+0x10>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    $0xa,%edi
call   1030 <hash@plt>
mov    $0x5,%edi
call   1030 <hash@plt>
mov    $0x5,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <hash@plt>

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

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