#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 = 0; i <= 100; i++) {
    if ((i + 1) % 2 == 0) {
      if ((i + 1) % 3 == 0) {
        {
          hash(1);
          hash(i);
          hash(((i - 1) / 2));
          hash(((i - 2) / 3));
        };
      }
    }
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jg     11ab <test+0x9b>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1198 <test+0x88>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1193 <test+0x83>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <hash@plt>
jmp    1198 <test+0x88>
jmp    119d <test+0x8d>
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   %r14
push   %rbx
xor    %r14d,%r14d
mov    $0x1,%bpl
jmp    112a <test+0x1a>
nopl   0x0(%rax)
add    $0x1,%bpl
cmp    $0x65,%r14d
je     1195 <test+0x85>
mov    %r14d,%ebx
lea    0x1(%rbx),%r14d
test   $0x1,%r14b
jne    1120 <test+0x10>
movzbl %bpl,%eax
imul   $0xab,%eax,%eax
shr    $0x9,%eax
lea    (%rax,%rax,2),%eax
add    $0xff,%al
cmp    %bl,%al
jne    1120 <test+0x10>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
call   1030 <hash@plt>
lea    -0x1(%rbx),%eax
mov    %eax,%ecx
shr    $0x7,%cl
add    %al,%cl
sar    %cl
movsbl %cl,%edi
call   1030 <hash@plt>
add    $0xfe,%ebx
movsbl %bl,%eax
imul   $0x56,%eax,%eax
movzwl %ax,%eax
mov    %eax,%ecx
shr    $0xf,%ecx
shr    $0x8,%eax
add    %cl,%al
movsbl %al,%edi
call   1030 <hash@plt>
jmp    1120 <test+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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